Use stub impl when libcros fails to load

Previous behavior would either:
a. Successfully load libcros. CrosLibrary::EnsureLoaded() returns true. Calls to libcros succeed.
b. Fail to load libcros. CrosLibrary::EnsureLoaded() returns false. Login is blocked. Calls to libcros fail (crash) if not protected and login is skipped for debugging.
c. Load a stub implementation if --stub-cros is specified. CrosLibrary::EnsureLoaded() returns true. Calls to libcros fail (crash).

Problems with this behavior:
1. CrosLibrary::EnsureLoaded() would be used incorrectly to protect calls to libcros outside of CrosLibrary non-stub implementations.
2. CrosLibrary non-stub implementations would still be called if libcros failed to load, so all calls to libcros in the non-stub implementations needed to be protected.

New behavior:
a. Successfully load libcros. CrosLibrary::libcros_loaded() returns true. Calls to libcros succeed.
b. Fail to load libcros. CrosLibrary::libcros_loaded() returns false. Stub implementation is used instead. load_error_string() specifies an error and login is blocked.
c. Load a stub implementation if --stub-cros is specified. CrosLibrary::libcros_loaded() returns false. Stub implementation is used.

BUG=chromium-os:20350
TEST=Test chrome for chromeos on linux and chromeos, with and without --stub-cros

Review URL: http://codereview.chromium.org/7891021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101876 0039d316-1c4b-4281-b951-d872f2087c98
19 files changed