diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 07:51:21 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 07:51:21 +0000 |
commit | 2970d53e5fc127f3e065f0a3dcea42984bbc4d4f (patch) | |
tree | 5661498f02d05b67abb0cf2cfa4201ec254b2490 /chrome/browser | |
parent | a7bb08ca2181f6c1f9d6030538d3266079db99d5 (diff) | |
download | chromium_src-2970d53e5fc127f3e065f0a3dcea42984bbc4d4f.zip chromium_src-2970d53e5fc127f3e065f0a3dcea42984bbc4d4f.tar.gz chromium_src-2970d53e5fc127f3e065f0a3dcea42984bbc4d4f.tar.bz2 |
cros: Remove use of libcros_loaded() in network_library.cc
Here, what matters is if the code is running on Chrome OS (hence the
D-Bus calls would work) or not, which can be checked with
base::chromeos::IsRunningOnChromeOS()
BUG=126719
TEST=none
R=hashimoto@chromium.org
Review URL: https://codereview.chromium.org/18980002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chromeos/cros/network_library.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc index 86297d7..97448e9 100644 --- a/chrome/browser/chromeos/cros/network_library.cc +++ b/chrome/browser/chromeos/cros/network_library.cc @@ -4,6 +4,7 @@ #include "chrome/browser/chromeos/cros/network_library.h" +#include "base/chromeos/chromeos_version.h" #include "base/i18n/icu_encoding_detection.h" #include "base/i18n/icu_string_conversions.h" #include "base/i18n/time_formatting.h" @@ -106,8 +107,8 @@ void WipeString(std::string* str) { str->clear(); } -bool EnsureCrosLoaded() { - if (!CrosLibrary::Get()->libcros_loaded()) { +bool EnsureRunningOnChromeOS() { + if (!base::chromeos::IsRunningOnChromeOS()) { return false; } else { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)) @@ -333,7 +334,7 @@ void Network::CopyCredentialsFromRemembered(Network* remembered) { void Network::SetValueProperty(const char* prop, const base::Value& value) { DCHECK(prop); - if (!EnsureCrosLoaded()) + if (!EnsureRunningOnChromeOS()) return; CrosSetNetworkServiceProperty(service_path_, prop, value); // Ensure NetworkStateHandler properties are up-to-date. @@ -345,7 +346,7 @@ void Network::SetValueProperty(const char* prop, const base::Value& value) { void Network::ClearProperty(const char* prop) { DCHECK(prop); - if (!EnsureCrosLoaded()) + if (!EnsureRunningOnChromeOS()) return; CrosClearNetworkServiceProperty(service_path_, prop); // Ensure NetworkStateHandler properties are up-to-date. @@ -495,7 +496,7 @@ std::string Network::GetErrorString() const { void Network::InitIPAddress() { ip_address_.clear(); - if (!EnsureCrosLoaded()) + if (!EnsureRunningOnChromeOS()) return; // If connected, get IPConfig. if (connected() && !device_path_.empty()) { @@ -860,7 +861,7 @@ CellularNetwork::~CellularNetwork() { } bool CellularNetwork::StartActivation() { - if (!EnsureCrosLoaded()) + if (!EnsureRunningOnChromeOS()) return false; if (!CrosActivateCellularModem(service_path(), "")) return false; @@ -872,7 +873,7 @@ bool CellularNetwork::StartActivation() { } void CellularNetwork::CompleteActivation() { - if (!EnsureCrosLoaded()) + if (!EnsureRunningOnChromeOS()) return; CrosCompleteCellularActivation(service_path()); } |