diff options
61 files changed, 165 insertions, 192 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index e0e6338..619d5d3 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -70,7 +70,7 @@ #if defined(OS_CHROMEOS) #include "ash/session_state_delegate.h" #include "ash/system/chromeos/keyboard_brightness_controller.h" -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #endif // defined(OS_CHROMEOS) namespace ash { @@ -901,7 +901,7 @@ bool AcceleratorController::PerformAction(int action, case POWER_PRESSED: // fallthrough case POWER_RELEASED: #if defined(OS_CHROMEOS) - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { // There is no powerd in linux desktop, so call the // PowerButtonController here. Shell::GetInstance()->power_button_controller()-> diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 3673140..53eb429 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -38,7 +38,7 @@ #include "ui/gfx/screen.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "base/time/time.h" #if defined(USE_X11) #include "ash/display/output_configurator_animation.h" @@ -225,7 +225,7 @@ DisplayController::DisplayController() #if defined(OS_CHROMEOS) CommandLine* command_line = CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kAshDisableDisplayChangeLimiter) && - base::chromeos::IsRunningOnChromeOS()) + base::SysInfo::IsRunningOnChromeOS()) limiter_.reset(new DisplayChangeLimiter); #endif // Reset primary display to make sure that tests don't use @@ -787,7 +787,7 @@ aura::RootWindow* DisplayController::AddRootWindowForDisplay( static bool force_constrain_pointer_to_root = CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshConstrainPointerToRoot); - if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) + if (base::SysInfo::IsRunningOnChromeOS() || force_constrain_pointer_to_root) root_window->ConfineCursorToWindow(); #endif return root_window; diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index 73a4ca2..f9ed407 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -33,7 +33,7 @@ #if defined(OS_CHROMEOS) #include "ash/display/output_configurator_animation.h" -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "chromeos/display/output_configurator.h" #endif @@ -149,7 +149,7 @@ DisplayManager::DisplayManager() change_display_upon_host_resize_(false), software_mirroring_enabled_(false) { #if defined(OS_CHROMEOS) - change_display_upon_host_resize_ = !base::chromeos::IsRunningOnChromeOS(); + change_display_upon_host_resize_ = !base::SysInfo::IsRunningOnChromeOS(); #endif } @@ -177,7 +177,7 @@ std::vector<float> DisplayManager::GetScalesForDisplay( ret.assign(kUIScalesFor1280, kUIScalesFor1280 + arraysize(kUIScalesFor1280)); #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) NOTREACHED() << "Unknown resolution:" << info.ToString(); #endif } @@ -388,7 +388,7 @@ void DisplayManager::SetDisplayResolution(int64 display_id, resolutions_[display_id] = resolution; } #if defined(OS_CHROMEOS) && defined(USE_X11) - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) Shell::GetInstance()->output_configurator()->ScheduleConfigureOutputs(); #endif } @@ -677,7 +677,7 @@ void DisplayManager::UpdateDisplays( delegate_->PostDisplayConfigurationChange(); #if defined(USE_X11) && defined(OS_CHROMEOS) - if (!changed_display_indices.empty() && base::chromeos::IsRunningOnChromeOS()) + if (!changed_display_indices.empty() && base::SysInfo::IsRunningOnChromeOS()) ui::ClearX11DefaultRootWindow(); #endif } @@ -736,7 +736,7 @@ void DisplayManager::SetMirrorMode(bool mirrored) { return; #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { chromeos::OutputState new_state = mirrored ? chromeos::STATE_DUAL_MIRROR : chromeos::STATE_DUAL_EXTENDED; Shell::GetInstance()->output_configurator()->SetDisplayMode(new_state); diff --git a/ash/shell.cc b/ash/shell.cc index 8e91497..123b81e 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -113,8 +113,8 @@ #include "ash/display/display_change_observer_chromeos.h" #include "ash/display/display_error_observer_chromeos.h" #include "ash/display/output_configurator_animation.h" -#include "base/chromeos/chromeos_version.h" #include "base/message_loop/message_pump_x11.h" +#include "base/sys_info.h" #include "chromeos/display/output_configurator.h" #include "content/public/browser/gpu_data_manager.h" #include "gpu/config/gpu_feature_type.h" @@ -407,7 +407,7 @@ void Shell::Init() { output_configurator_animation_.reset( new internal::OutputConfiguratorAnimation()); output_configurator_->AddObserver(output_configurator_animation_.get()); - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { display_change_observer_.reset(new internal::DisplayChangeObserver); // Register |display_change_observer_| first so that the rest of // observer gets invoked after the root windows are configured. diff --git a/ash/wm/lock_state_controller_impl2.cc b/ash/wm/lock_state_controller_impl2.cc index c5301b7..dae62c4 100644 --- a/ash/wm/lock_state_controller_impl2.cc +++ b/ash/wm/lock_state_controller_impl2.cc @@ -12,16 +12,13 @@ #include "ash/wm/session_state_animator.h" #include "base/bind_helpers.h" #include "base/command_line.h" +#include "base/sys_info.h" #include "base/timer/timer.h" #include "ui/aura/root_window.h" #include "ui/compositor/layer_animation_sequence.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/views/corewm/compound_event_filter.h" -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace ash { namespace { @@ -369,7 +366,7 @@ void LockStateControllerImpl2::StartRealShutdownTimer( void LockStateControllerImpl2::OnRealShutdownTimeout() { DCHECK(shutting_down_); #if defined(OS_CHROMEOS) - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { ShellDelegate* delegate = Shell::GetInstance()->delegate(); if (delegate) { delegate->Exit(); diff --git a/ash/wm/session_state_controller_impl.cc b/ash/wm/session_state_controller_impl.cc index dbd97a7..63b0d1f 100644 --- a/ash/wm/session_state_controller_impl.cc +++ b/ash/wm/session_state_controller_impl.cc @@ -11,13 +11,10 @@ #include "ash/shell_window_ids.h" #include "ash/wm/session_state_animator.h" #include "base/command_line.h" +#include "base/sys_info.h" #include "ui/aura/root_window.h" #include "ui/views/corewm/compound_event_filter.h" -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace ash { SessionStateControllerImpl::TestApi::TestApi( @@ -321,7 +318,7 @@ void SessionStateControllerImpl::StartRealShutdownTimer() { void SessionStateControllerImpl::OnRealShutdownTimeout() { DCHECK(shutting_down_); #if defined(OS_CHROMEOS) - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { ShellDelegate* delegate = Shell::GetInstance()->delegate(); if (delegate) { delegate->Exit(); diff --git a/base/base.gypi b/base/base.gypi index 8621208..9b941a8 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -110,8 +110,6 @@ 'callback_internal.h', 'callback_list.h', 'cancelable_callback.h', - 'chromeos/chromeos_version.cc', - 'chromeos/chromeos_version.h', 'command_line.cc', 'command_line.h', 'compiler_specific.h', diff --git a/base/chromeos/chromeos_version.cc b/base/chromeos/chromeos_version.cc deleted file mode 100644 index 4a70cd5..0000000 --- a/base/chromeos/chromeos_version.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/chromeos/chromeos_version.h" - -#include <stdlib.h> -#include <string.h> - -#include "base/logging.h" - -namespace base { -namespace chromeos { - -bool IsRunningOnChromeOS() { - // Check if the user name is chronos. Note that we don't go with - // getuid() + getpwuid_r() as it may end up reading /etc/passwd, which - // can be expensive. - const char* user = getenv("USER"); - return user && strcmp(user, "chronos") == 0; -} - -} // namespace chromeos -} // namespace base diff --git a/base/chromeos/chromeos_version.h b/base/chromeos/chromeos_version.h deleted file mode 100644 index 25acd43..0000000 --- a/base/chromeos/chromeos_version.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef BASE_CHROMEOS_CHROMEOS_VERSION_H_ -#define BASE_CHROMEOS_CHROMEOS_VERSION_H_ - -#include "base/base_export.h" - -namespace base { -namespace chromeos { - -// Returns true if the browser is running on Chrome OS. -// Useful for implementing stubs for Linux desktop. -BASE_EXPORT bool IsRunningOnChromeOS(); - -} // namespace chromeos -} // namespace base - -#endif // BASE_CHROMEOS_CHROMEOS_VERSION_H_ diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 762700a..296950b 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -43,6 +43,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" @@ -54,10 +55,6 @@ #include <grp.h> #endif -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace base { namespace { @@ -771,7 +768,7 @@ bool GetShmemTempDir(FilePath* path, bool executable) { FilePath GetHomeDir() { #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) return FilePath("/home/chronos/user"); #endif diff --git a/base/sys_info.h b/base/sys_info.h index 564832d..ba45bfc 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -96,6 +96,9 @@ class BASE_EXPORT SysInfo { // time of the Chrome OS build). static Time GetLsbReleaseTime(); + // Returns true when actually running in a Chrome OS environment. + static bool IsRunningOnChromeOS(); + // Test method to force re-parsing of lsb-release. static void SetChromeOSVersionInfoForTest(const std::string& lsb_release, const Time& lsb_release_time); diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc index 9d7505e..e0f8b4f 100644 --- a/base/sys_info_chromeos.cc +++ b/base/sys_info_chromeos.cc @@ -25,8 +25,13 @@ const char* kLinuxStandardBaseVersionKeys[] = { "GOOGLE_RELEASE", "DISTRIB_RELEASE", }; -const size_t kLinuxStandardBaseVersionKeysLength = - arraysize(kLinuxStandardBaseVersionKeys); + +const char kChromeOsReleaseNameKey[] = "CHROMEOS_RELEASE_NAME"; + +const char* const kChromeOsReleaseNames[] = { + "Chrome OS", + "Chromium OS", +}; const char kLinuxStandardBaseReleaseFile[] = "/etc/lsb-release"; @@ -48,6 +53,7 @@ class ChromeOSVersionInfo { major_version_ = 0; minor_version_ = 0; bugfix_version_ = 0; + is_running_on_chromeos_ = false; std::string lsb_release, lsb_release_time_str; scoped_ptr<base::Environment> env(base::Environment::Create()); @@ -95,6 +101,7 @@ class ChromeOSVersionInfo { const SysInfo::LsbReleaseMap& lsb_release_map() const { return lsb_release_map_; } + bool is_running_on_chromeos() const { return is_running_on_chromeos_; } private: void ParseLsbRelease(const std::string& lsb_release) { @@ -113,7 +120,7 @@ class ChromeOSVersionInfo { } // Parse the version from the first matching recognized version key. std::string version; - for (size_t i = 0; i < kLinuxStandardBaseVersionKeysLength; ++i) { + for (size_t i = 0; i < arraysize(kLinuxStandardBaseVersionKeys); ++i) { std::string key = kLinuxStandardBaseVersionKeys[i]; if (GetLsbReleaseValue(key, &version) && !version.empty()) break; @@ -131,6 +138,17 @@ class ChromeOSVersionInfo { StringToInt(StringPiece(tokenizer.token_begin(), tokenizer.token_end()), &bugfix_version_); } + + // Check release name for Chrome OS. + std::string release_name; + if (GetLsbReleaseValue(kChromeOsReleaseNameKey, &release_name)) { + for (size_t i = 0; i < arraysize(kChromeOsReleaseNames); ++i) { + if (release_name == kChromeOsReleaseNames[i]) { + is_running_on_chromeos_ = true; + break; + } + } + } } base::Time lsb_release_time_; @@ -138,6 +156,7 @@ class ChromeOSVersionInfo { int32 major_version_; int32 minor_version_; int32 bugfix_version_; + bool is_running_on_chromeos_; }; static LazyInstance<ChromeOSVersionInfo> @@ -182,6 +201,11 @@ base::Time SysInfo::GetLsbReleaseTime() { } // static +bool SysInfo::IsRunningOnChromeOS() { + return GetChromeOSVersionInfo().is_running_on_chromeos(); +} + +// static void SysInfo::SetChromeOSVersionInfoForTest(const std::string& lsb_release, const Time& lsb_release_time) { scoped_ptr<base::Environment> env(base::Environment::Create()); diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc index 6dc325f..eacf76c 100644 --- a/base/sys_info_unittest.cc +++ b/base/sys_info_unittest.cc @@ -121,4 +121,26 @@ TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) { parsed_lsb_release_time.ToDoubleT()); } +TEST_F(SysInfoTest, IsRunningOnChromeOS) { + base::SysInfo::SetChromeOSVersionInfoForTest("", base::Time()); + EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS()); + + const char* kLsbRelease1 = + "CHROMEOS_RELEASE_NAME=Non Chrome OS\n" + "CHROMEOS_RELEASE_VERSION=1.2.3.4\n"; + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time()); + EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS()); + + const char* kLsbRelease2 = + "CHROMEOS_RELEASE_NAME=Chrome OS\n" + "CHROMEOS_RELEASE_VERSION=1.2.3.4\n"; + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); + EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); + + const char* kLsbRelease3 = + "CHROMEOS_RELEASE_NAME=Chromium OS\n"; + base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time()); + EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); +} + #endif // OS_CHROMEOS diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc index 232b8b8..64f7418 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc @@ -8,12 +8,12 @@ #include <set> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/path_service.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/stl_util.h" +#include "base/sys_info.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" @@ -168,7 +168,7 @@ void KioskAppManager::OnReadImmutableAttributes( g_browser_process->browser_policy_connector()->GetInstallAttributes(); switch (attributes->GetMode()) { case policy::DEVICE_MODE_NOT_SET: { - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { status = CONSUMER_KIOSK_MODE_CONFIGURABLE; } else if (!ownership_established_) { bool* owner_present = new bool(false); diff --git a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc index ea4b527..dd19fa4 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_profile_loader.cc @@ -4,11 +4,11 @@ #include "chrome/browser/chromeos/app_mode/kiosk_profile_loader.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" +#include "base/sys_info.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" #include "chrome/browser/chromeos/login/login_display_host_impl.h" #include "chrome/browser/chromeos/login/login_status_consumer.h" @@ -113,7 +113,7 @@ class KioskProfileLoader::CryptohomedChecker LOG(ERROR) << "Cryptohome is mounted before launching kiosk app."; // Proceed only when cryptohome is not mounded or running on dev box. - if (!is_mounted || !base::chromeos::IsRunningOnChromeOS()) + if (!is_mounted || !base::SysInfo::IsRunningOnChromeOS()) ReportCheckResult(KioskAppLaunchError::NONE); else ReportCheckResult(KioskAppLaunchError::ALREADY_MOUNTED); diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index fd251f28..41687b4 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -11,7 +11,6 @@ #include "ash/shell.h" #include "base/bind.h" #include "base/callback.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/lazy_instance.h" @@ -259,7 +258,7 @@ namespace internal { class DBusServices { public: explicit DBusServices(const content::MainFunctionParams& parameters) { - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { // Override this path on the desktop, so that the user policy key can be // stored by the stub SessionManagerClient. base::FilePath user_data_dir; @@ -299,7 +298,7 @@ class DBusServices { // detector starts to monitor changes from the update engine. UpgradeDetectorChromeos::GetInstance()->Init(); - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { // Disable Num Lock on X start up for http://crosbug.com/29169. input_method::InputMethodManager::Get()->GetXKeyboard()-> SetNumLockEnabled(false); @@ -370,7 +369,7 @@ void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { // If we're not running on real ChromeOS hardware (or under VM), and are not // showing the login manager or attempting a command line login, login with a // stub user. - if (!base::chromeos::IsRunningOnChromeOS() && + if (!base::SysInfo::IsRunningOnChromeOS() && !parsed_command_line().HasSwitch(switches::kLoginManager) && !parsed_command_line().HasSwitch(switches::kLoginUser) && !parsed_command_line().HasSwitch(switches::kGuestSession)) { @@ -440,7 +439,7 @@ void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { // volume on the login screen, if Chrome is running on Chrome OS // (i.e. not Linux desktop), and in non-test mode. // Note: SystemKeyEventListener depends on the DBus thread. - if (base::chromeos::IsRunningOnChromeOS() && + if (base::SysInfo::IsRunningOnChromeOS() && !parameters().ui_task) { // ui_task is non-NULL when running tests. SystemKeyEventListener::Initialize(); } diff --git a/chrome/browser/chromeos/dbus/cros_dbus_service.cc b/chrome/browser/chromeos/dbus/cros_dbus_service.cc index aefccdb..76be30b 100644 --- a/chrome/browser/chromeos/dbus/cros_dbus_service.cc +++ b/chrome/browser/chromeos/dbus/cros_dbus_service.cc @@ -5,8 +5,8 @@ #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/stl_util.h" +#include "base/sys_info.h" #include "base/threading/platform_thread.h" #include "chrome/browser/chromeos/dbus/display_power_service_provider.h" #include "chrome/browser/chromeos/dbus/liveness_service_provider.h" @@ -118,7 +118,7 @@ void CrosDBusService::Initialize() { return; } dbus::Bus* bus = DBusThreadManager::Get()->GetSystemBus(); - if (base::chromeos::IsRunningOnChromeOS() && bus) { + if (base::SysInfo::IsRunningOnChromeOS() && bus) { CrosDBusServiceImpl* service = new CrosDBusServiceImpl(bus); service->RegisterServiceProvider(ProxyResolutionServiceProvider::Create()); service->RegisterServiceProvider(new DisplayPowerServiceProvider); diff --git a/chrome/browser/chromeos/input_method/input_method_configuration.cc b/chrome/browser/chromeos/input_method/input_method_configuration.cc index 8bec1b2..e44eefa 100644 --- a/chrome/browser/chromeos/input_method/input_method_configuration.cc +++ b/chrome/browser/chromeos/input_method/input_method_configuration.cc @@ -5,7 +5,6 @@ #include "chrome/browser/chromeos/input_method/input_method_configuration.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chromeos/input_method/browser_state_monitor.h" diff --git a/chrome/browser/chromeos/input_method/input_method_persistence.cc b/chrome/browser/chromeos/input_method/input_method_persistence.cc index da37994..47beee5 100644 --- a/chrome/browser/chromeos/input_method/input_method_persistence.cc +++ b/chrome/browser/chromeos/input_method/input_method_persistence.cc @@ -4,9 +4,9 @@ #include "chrome/browser/chromeos/input_method/input_method_persistence.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/prefs/pref_service.h" +#include "base/sys_info.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/language_preferences.h" @@ -47,7 +47,7 @@ static void SetUserLRUInputMethod( return; const std::string username = profile->GetProfileName(); - if (base::chromeos::IsRunningOnChromeOS() && !username.empty() && + if (base::SysInfo::IsRunningOnChromeOS() && !username.empty() && !local_state->ReadOnly()) { bool update_succeed = false; { diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 829ae19..659aeee 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -7,7 +7,6 @@ #include <vector> #include "ash/ash_switches.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" @@ -17,6 +16,7 @@ #include "base/process/launch.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "base/timer/timer.h" #include "base/values.h" #include "cc/base/switches.h" @@ -358,7 +358,7 @@ void RestartChrome(const std::string& command_line) { } restart_requested = true; - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { // Relaunch chrome without session manager on dev box. ReLaunch(command_line); return; diff --git a/chrome/browser/chromeos/login/default_user_images.cc b/chrome/browser/chromeos/login/default_user_images.cc index d99429a..30019e6 100644 --- a/chrome/browser/chromeos/login/default_user_images.cc +++ b/chrome/browser/chromeos/login/default_user_images.cc @@ -5,12 +5,12 @@ #include "chrome/browser/chromeos/login/default_user_images.h" #include "base/basictypes.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -74,7 +74,7 @@ const int kDefaultImageDescriptions[] = { // image if its valid. std::string GetDefaultImageString(int index, const std::string& prefix) { if (index < 0 || index >= kDefaultImagesCount) { - DCHECK(!base::chromeos::IsRunningOnChromeOS()); + DCHECK(!base::SysInfo::IsRunningOnChromeOS()); return std::string(); } return base::StringPrintf("%s%d", prefix.c_str(), index); diff --git a/chrome/browser/chromeos/login/hwid_checker.cc b/chrome/browser/chromeos/login/hwid_checker.cc index 49f9874..a04ee14 100644 --- a/chrome/browser/chromeos/login/hwid_checker.cc +++ b/chrome/browser/chromeos/login/hwid_checker.cc @@ -6,10 +6,10 @@ #include <cstdio> -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/logging.h" #include "base/strings/string_util.h" +#include "base/sys_info.h" #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/common/chrome_switches.h" #include "chromeos/chromeos_switches.h" @@ -116,7 +116,7 @@ bool IsMachineHWIDCorrect() { if (cmd_line->HasSwitch(::switches::kTestType) || cmd_line->HasSwitch(chromeos::switches::kSkipHWIDCheck)) return true; - if (!base::chromeos::IsRunningOnChromeOS()) + if (!base::SysInfo::IsRunningOnChromeOS()) return true; std::string hwid; chromeos::system::StatisticsProvider* stats = @@ -133,4 +133,3 @@ bool IsMachineHWIDCorrect() { } } // namespace chromeos - diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index cd4ac83..0e3dd68 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -7,7 +7,6 @@ #include <algorithm> #include <vector> -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/file_util.h" @@ -24,6 +23,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" +#include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/worker_pool.h" #include "base/time/time.h" @@ -330,7 +330,7 @@ void LoginUtilsImpl::PrepareProfile( btl->AddLoginTimeMarker("UserLoggedIn-End", false); // Switch log file as soon as possible. - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); // Update user's displayed email. diff --git a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc index 6f2f70a..9ed61d1 100644 --- a/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc +++ b/chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.cc @@ -5,11 +5,11 @@ #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_controller.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/sequenced_worker_pool.h" #include "base/values.h" @@ -37,7 +37,7 @@ const int kUserCreationTimeoutSeconds = 30; // 30 seconds. bool StoreManagedUserFiles(const std::string& token, const base::FilePath& base_path) { - if (!base::chromeos::IsRunningOnChromeOS()) { + if (!base::SysInfo::IsRunningOnChromeOS()) { // If running on desktop, cryptohome stub does not create home directory. file_util::CreateDirectory(base_path); } diff --git a/chrome/browser/chromeos/login/startup_utils.cc b/chrome/browser/chromeos/login/startup_utils.cc index 7977d0e..a32c987 100644 --- a/chrome/browser/chromeos/login/startup_utils.cc +++ b/chrome/browser/chromeos/login/startup_utils.cc @@ -5,11 +5,11 @@ #include "chrome/browser/chromeos/login/startup_utils.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" +#include "base/sys_info.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_paths.h" @@ -95,7 +95,7 @@ static base::FilePath GetOobeCompleteFlagPath() { // The constant is defined here so it won't be referenced directly. const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed"; - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { return base::FilePath(kOobeCompleteFlagFilePath); } else { base::FilePath user_data_dir; diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc index 9e20d44..cecbdde 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.cc +++ b/chrome/browser/chromeos/login/user_manager_impl.cc @@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/files/file_path.h" @@ -21,6 +20,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "base/values.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" @@ -1045,7 +1045,7 @@ bool UserManagerImpl::UserSessionsRestored() const { bool UserManagerImpl::HasBrowserRestarted() const { CommandLine* command_line = CommandLine::ForCurrentProcess(); - return base::chromeos::IsRunningOnChromeOS() && + return base::SysInfo::IsRunningOnChromeOS() && command_line->HasSwitch(switches::kLoginUser) && !command_line->HasSwitch(switches::kLoginPassword); } diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc index 6b51e5f..df7e02b 100644 --- a/chrome/browser/chromeos/login/version_info_updater.cc +++ b/chrome/browser/chromeos/login/version_info_updater.cc @@ -8,10 +8,10 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/chromeos/chromeos_version.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" #include "chrome/browser/chromeos/settings/cros_settings.h" @@ -55,7 +55,7 @@ VersionInfoUpdater::~VersionInfoUpdater() { } void VersionInfoUpdater::StartUpdate(bool is_official_build) { - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { version_loader_.GetVersion( is_official_build ? VersionLoader::VERSION_SHORT_WITH_DATE : VersionLoader::VERSION_FULL, diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index ce8daf8..bb86c64 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -6,7 +6,6 @@ #include "ash/magnifier/magnifier_constants.h" #include "ash/shell.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/i18n/time_formatting.h" #include "base/metrics/histogram.h" @@ -15,6 +14,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/accessibility/magnification_manager.h" @@ -85,7 +85,7 @@ void Preferences::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { std::string hardware_keyboard_id; // TODO(yusukes): Remove the runtime hack. - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { input_method::InputMethodManager* manager = input_method::InputMethodManager::Get(); if (manager) { @@ -627,7 +627,7 @@ void Preferences::SetInputMethodList() { void Preferences::UpdateAutoRepeatRate() { // Avoid setting repeat rate on desktop dev environment. - if (!base::chromeos::IsRunningOnChromeOS()) + if (!base::SysInfo::IsRunningOnChromeOS()) return; input_method::AutoRepeatRate rate; diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc index 90f9e87..5d6af65 100644 --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc @@ -34,13 +34,13 @@ #include "ash/wm/lock_state_controller.h" #include "base/bind_helpers.h" #include "base/callback.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/logging.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "base/time/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" @@ -494,7 +494,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, } virtual bool IsOobeCompleted() const OVERRIDE { - if (!base::chromeos::IsRunningOnChromeOS() && + if (!base::SysInfo::IsRunningOnChromeOS() && LoginState::Get()->IsUserLoggedIn()) return true; return StartupUtils::IsOobeCompleted(); @@ -1263,7 +1263,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, // Overridden from SystemKeyEventListener::CapsLockObserver. virtual void OnCapsLockChange(bool enabled) OVERRIDE { bool search_mapped_to_caps_lock = false; - if (!base::chromeos::IsRunningOnChromeOS() || + if (!base::SysInfo::IsRunningOnChromeOS() || search_key_mapped_to_ == input_method::kCapsLockKey) search_mapped_to_caps_lock = true; GetSystemTrayNotifier()->NotifyCapsLockChanged( diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc index e6eed85..bbc6ed1 100644 --- a/chrome/browser/chromeos/system/input_device_settings.cc +++ b/chrome/browser/chromeos/system/input_device_settings.cc @@ -9,7 +9,6 @@ #include <vector> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/files/file_path.h" @@ -19,6 +18,7 @@ #include "base/process/launch.h" #include "base/process/process_handle.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "base/task_runner.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/browser_process.h" @@ -52,7 +52,7 @@ void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) { const std::string& script(argv[0]); // Script must exist on device. - DCHECK(!base::chromeos::IsRunningOnChromeOS() || ScriptExists(script)); + DCHECK(!base::SysInfo::IsRunningOnChromeOS() || ScriptExists(script)); if (!ScriptExists(script)) return; diff --git a/chrome/browser/chromeos/system/statistics_provider.cc b/chrome/browser/chromeos/system/statistics_provider.cc index 6de3b6f..b6d3ad4 100644 --- a/chrome/browser/chromeos/system/statistics_provider.cc +++ b/chrome/browser/chromeos/system/statistics_provider.cc @@ -5,13 +5,13 @@ #include "chrome/browser/chromeos/system/statistics_provider.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h" #include "base/memory/singleton.h" #include "base/path_service.h" #include "base/synchronization/waitable_event.h" +#include "base/sys_info.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "chromeos/app_mode/kiosk_oem_manifest_parser.h" @@ -295,7 +295,7 @@ class StatisticsProviderStubImpl : public StatisticsProviderImpl { }; StatisticsProvider* StatisticsProvider::GetInstance() { - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { return StatisticsProviderImpl::GetInstance(); } else { return StatisticsProviderStubImpl::GetInstance(); diff --git a/chrome/browser/chromeos/system/timezone_settings.cc b/chrome/browser/chromeos/system/timezone_settings.cc index 5f9b4d8..d51d638 100644 --- a/chrome/browser/chromeos/system/timezone_settings.cc +++ b/chrome/browser/chromeos/system/timezone_settings.cc @@ -7,7 +7,6 @@ #include <string> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/logging.h" @@ -17,6 +16,7 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/sys_info.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" @@ -442,7 +442,7 @@ TimezoneSettings::Observer::~Observer() {} // static TimezoneSettings* TimezoneSettings::GetInstance() { - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { return TimezoneSettingsImpl::GetInstance(); } else { return TimezoneSettingsStubImpl::GetInstance(); diff --git a/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc b/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc index 48c773b..e92b9e0 100644 --- a/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc +++ b/chrome/browser/extensions/api/braille_display_private/brlapi_connection.cc @@ -4,8 +4,8 @@ #include "chrome/browser/extensions/api/braille_display_private/brlapi_connection.h" -#include "base/chromeos/chromeos_version.h" #include "base/message_loop/message_loop.h" +#include "base/sys_info.h" namespace extensions { using base::MessageLoopForIO; @@ -87,7 +87,7 @@ bool BrlapiConnectionImpl::Connect(const OnDataReadyCallback& on_data_ready) { int path[2] = {0, 0}; int pathElements = 0; #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) path[pathElements++] = kDefaultTtyChromeOS; #endif if (pathElements == 0 && getenv("WINDOWPATH") == NULL) diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc index 846500c..faeb3b5 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc @@ -5,8 +5,8 @@ #include "chrome/browser/extensions/api/terminal/terminal_private_api.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/json/json_writer.h" +#include "base/sys_info.h" #include "base/values.h" #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" #include "chrome/browser/extensions/event_router.h" @@ -32,7 +32,7 @@ const char kCroshCommand[] = "/usr/bin/crosh"; const char kStubbedCroshCommand[] = "cat"; const char* GetCroshPath() { - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) return kCroshCommand; else return kStubbedCroshCommand; diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc index a160d71..0693c58 100644 --- a/chrome/browser/lifetime/application_lifetime.cc +++ b/chrome/browser/lifetime/application_lifetime.cc @@ -36,7 +36,7 @@ #include "content/public/browser/notification_service.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -335,7 +335,7 @@ void NotifyAndTerminate(bool fast_path) { NotifyAppTerminating(); #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { // If we're on a ChromeOS device, reboot if an update has been applied, // or else signal the session manager to log out. chromeos::UpdateEngineClient* update_engine_client diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index 11a211f..4de27d4 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc @@ -52,8 +52,8 @@ #include "net/url_request/url_request.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" +#include "base/sys_info.h" #include "chrome/common/chrome_switches.h" #endif @@ -641,7 +641,7 @@ bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, #if defined(OS_CHROMEOS) // If we're running Chrome for ChromeOS on Linux, we want to allow file // access. - if (!base::chromeos::IsRunningOnChromeOS() || + if (!base::SysInfo::IsRunningOnChromeOS() || CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { return true; } diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc index 71e1980..8fbecad 100644 --- a/chrome/browser/ui/ash/ash_init.cc +++ b/chrome/browser/ui/ash/ash_init.cc @@ -24,7 +24,7 @@ #include "ui/aura/root_window.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "chrome/browser/ui/ash/ime_controller_chromeos.h" #include "chrome/browser/ui/ash/volume_controller_chromeos.h" #include "chromeos/chromeos_switches.h" @@ -44,7 +44,7 @@ bool ShouldOpenAshOnStartup() { void OpenAsh() { #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { // Hides the cursor outside of the Aura root window. The cursor will be // drawn within the Aura root window, and it'll remain hidden after the // Aura window is closed. diff --git a/chrome/browser/ui/ash/caps_lock_delegate_chromeos.cc b/chrome/browser/ui/ash/caps_lock_delegate_chromeos.cc index a58fab8..acddcb5 100644 --- a/chrome/browser/ui/ash/caps_lock_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/caps_lock_delegate_chromeos.cc @@ -4,16 +4,16 @@ #include "chrome/browser/ui/ash/caps_lock_delegate_chromeos.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/sys_info.h" #include "chrome/common/chrome_switches.h" #include "chromeos/ime/xkeyboard.h" #include "content/public/browser/browser_thread.h" CapsLockDelegate::CapsLockDelegate(chromeos::input_method::XKeyboard* xkeyboard) : xkeyboard_(xkeyboard), - is_running_on_chromeos_(base::chromeos::IsRunningOnChromeOS()), + is_running_on_chromeos_(base::SysInfo::IsRunningOnChromeOS()), caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) { chromeos::SystemKeyEventListener* system_event_listener = chromeos::SystemKeyEventListener::GetInstance(); diff --git a/chrome/browser/ui/ash/event_rewriter.cc b/chrome/browser/ui/ash/event_rewriter.cc index f80b08d..344821d 100644 --- a/chrome/browser/ui/ash/event_rewriter.cc +++ b/chrome/browser/ui/ash/event_rewriter.cc @@ -25,8 +25,8 @@ // Get rid of a macro from Xlib.h that conflicts with OwnershipService class. #undef Status -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" +#include "base/sys_info.h" #include "chrome/browser/chromeos/keyboard_driven_event_rewriter.h" #include "chrome/browser/chromeos/login/login_display_host_impl.h" #include "chrome/browser/chromeos/login/user_manager.h" @@ -156,7 +156,7 @@ EventRewriter::EventRewriter() if (ash::Shell::HasInstance()) ash::Shell::GetPrimaryRootWindow()->AddRootWindowObserver(this); #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { chromeos::XInputHierarchyChangedEventListener::GetInstance() ->AddObserver(this); } @@ -168,7 +168,7 @@ EventRewriter::~EventRewriter() { if (ash::Shell::HasInstance()) ash::Shell::GetPrimaryRootWindow()->RemoveRootWindowObserver(this); #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { chromeos::XInputHierarchyChangedEventListener::GetInstance() ->RemoveObserver(this); } diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index c927742..9affb55 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc @@ -5,7 +5,6 @@ #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "base/callback.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/debug/trace_event.h" #include "base/logging.h" diff --git a/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc b/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc index d7ee7f7..bc580cc 100644 --- a/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc +++ b/chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc @@ -10,9 +10,9 @@ #include <vector> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/memory/scoped_ptr.h" +#include "base/sys_info.h" #include "base/values.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/settings/cros_settings.h" @@ -199,7 +199,7 @@ void KioskAppsHandler::OnGetConsumerKioskModeStatus( is_kiosk_enabled_ = ((status == KioskAppManager::CONSUMER_KIOSK_MODE_ENABLED) && chromeos::UserManager::Get()->IsCurrentUserOwner()) || - !base::chromeos::IsRunningOnChromeOS(); + !base::SysInfo::IsRunningOnChromeOS(); if (is_kiosk_enabled_) { base::FundamentalValue enabled(is_kiosk_enabled_); diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index 74088b9..405c7fd 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc @@ -33,7 +33,7 @@ #include "ui/base/resource/resource_bundle.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/owner_flags_storage.h" @@ -74,7 +74,7 @@ content::WebUIDataSource* CreateFlagsUIHTMLSource() { #if defined(OS_CHROMEOS) if (!chromeos::UserManager::Get()->IsCurrentUserOwner() && - base::chromeos::IsRunningOnChromeOS()) { + base::SysInfo::IsRunningOnChromeOS()) { // Set the strings to show which user can actually change the flags. std::string owner; chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); diff --git a/chrome/browser/usb/usb_device.cc b/chrome/browser/usb/usb_device.cc index 0212842..f4f9340 100644 --- a/chrome/browser/usb/usb_device.cc +++ b/chrome/browser/usb/usb_device.cc @@ -13,7 +13,7 @@ #include "third_party/libusb/src/libusb/libusb.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" +#include "base/sys_info.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/permission_broker_client.h" #endif // defined(OS_CHROMEOS) @@ -74,7 +74,7 @@ void UsbDevice::RequestUsbAcess( // ChromeOS builds on non-ChromeOS machines (dev) should not attempt to // use permission broker. - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { chromeos::PermissionBrokerClient* client = chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient(); DCHECK(client) << "Could not get permission broker client."; diff --git a/chromeos/cert_loader.cc b/chromeos/cert_loader.cc index 62a4f12..ecae58a 100644 --- a/chromeos/cert_loader.cc +++ b/chromeos/cert_loader.cc @@ -6,11 +6,11 @@ #include <algorithm> -#include "base/chromeos/chromeos_version.h" #include "base/message_loop/message_loop_proxy.h" #include "base/observer_list.h" #include "base/sequenced_task_runner.h" #include "base/strings/string_number_conversions.h" +#include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/worker_pool.h" #include "chromeos/dbus/cryptohome_client.h" @@ -52,7 +52,7 @@ void CallOpenPersistentNSSDB() { VLOG(1) << "CallOpenPersistentNSSDB"; // Ensure we've opened the user's key/certificate database. - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) crypto::OpenPersistentNSSDB(); crypto::EnableTPMTokenForNSS(); } @@ -159,7 +159,7 @@ void CertLoader::MaybeRequestCertificates() { // Ensure we only initialize the TPM token once. DCHECK_EQ(tpm_token_state_, TPM_STATE_UNKNOWN); - if (!initialize_tpm_for_test_ && !base::chromeos::IsRunningOnChromeOS()) + if (!initialize_tpm_for_test_ && !base::SysInfo::IsRunningOnChromeOS()) tpm_token_state_ = TPM_DISABLED; // Treat TPM as disabled for guest users since they do not store certs. diff --git a/chromeos/cryptohome/cryptohome_library.cc b/chromeos/cryptohome/cryptohome_library.cc index 27afb23..9222ac5 100644 --- a/chromeos/cryptohome/cryptohome_library.cc +++ b/chromeos/cryptohome/cryptohome_library.cc @@ -7,10 +7,10 @@ #include <map> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/sys_info.h" #include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/dbus_method_call_status.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -110,7 +110,7 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary { virtual std::string EncryptWithSystemSalt(const std::string& token) OVERRIDE { // Don't care about token encryption while debugging. - if (!base::chromeos::IsRunningOnChromeOS()) + if (!base::SysInfo::IsRunningOnChromeOS()) return token; if (!LoadSystemSaltKey()) { @@ -125,7 +125,7 @@ class CryptohomeLibraryImpl : public CryptohomeLibrary { virtual std::string DecryptWithSystemSalt( const std::string& encrypted_token_hex) OVERRIDE { // Don't care about token encryption while debugging. - if (!base::chromeos::IsRunningOnChromeOS()) + if (!base::SysInfo::IsRunningOnChromeOS()) return encrypted_token_hex; if (!LoadSystemSaltKey()) { @@ -301,7 +301,7 @@ static CryptohomeLibrary* g_test_cryptohome_library = NULL; // static void CryptohomeLibrary::Initialize() { CHECK(!g_cryptohome_library); - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) g_cryptohome_library = new CryptohomeLibraryImpl(); else g_cryptohome_library = new CryptohomeLibraryStubImpl(); diff --git a/chromeos/dbus/bluetooth_agent_service_provider.cc b/chromeos/dbus/bluetooth_agent_service_provider.cc index ece8096..25e07fe 100644 --- a/chromeos/dbus/bluetooth_agent_service_provider.cc +++ b/chromeos/dbus/bluetooth_agent_service_provider.cc @@ -7,9 +7,9 @@ #include <string> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/ref_counted.h" +#include "base/sys_info.h" #include "base/threading/platform_thread.h" #include "chromeos/dbus/fake_bluetooth_agent_service_provider.h" #include "dbus/bus.h" @@ -469,7 +469,7 @@ BluetoothAgentServiceProvider* BluetoothAgentServiceProvider::Create( dbus::Bus* bus, const dbus::ObjectPath& object_path, Delegate* delegate) { - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { return new BluetoothAgentServiceProviderImpl(bus, object_path, delegate); } else { return new FakeBluetoothAgentServiceProvider(object_path, delegate); diff --git a/chromeos/dbus/bluetooth_profile_service_provider.cc b/chromeos/dbus/bluetooth_profile_service_provider.cc index dda9714..a465873 100644 --- a/chromeos/dbus/bluetooth_profile_service_provider.cc +++ b/chromeos/dbus/bluetooth_profile_service_provider.cc @@ -7,9 +7,9 @@ #include <string> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/ref_counted.h" +#include "base/sys_info.h" #include "base/threading/platform_thread.h" #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h" #include "dbus/bus.h" @@ -252,7 +252,7 @@ BluetoothProfileServiceProvider* BluetoothProfileServiceProvider::Create( dbus::Bus* bus, const dbus::ObjectPath& object_path, Delegate* delegate) { - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { return new BluetoothProfileServiceProviderImpl(bus, object_path, delegate); } else { return new FakeBluetoothProfileServiceProvider(object_path, delegate); diff --git a/chromeos/dbus/cros_disks_client.cc b/chromeos/dbus/cros_disks_client.cc index 4f52483..8a5f9e6 100644 --- a/chromeos/dbus/cros_disks_client.cc +++ b/chromeos/dbus/cros_disks_client.cc @@ -7,13 +7,13 @@ #include <map> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/location.h" #include "base/message_loop/message_loop_proxy.h" #include "base/stl_util.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/worker_pool.h" #include "base/values.h" @@ -722,14 +722,14 @@ CrosDisksClient* CrosDisksClient::Create(DBusClientImplementationType type) { // static base::FilePath CrosDisksClient::GetArchiveMountPoint() { - return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? + return base::FilePath(base::SysInfo::IsRunningOnChromeOS() ? FILE_PATH_LITERAL("/media/archive") : FILE_PATH_LITERAL("/tmp/chromeos/media/archive")); } // static base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { - return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? + return base::FilePath(base::SysInfo::IsRunningOnChromeOS() ? FILE_PATH_LITERAL("/media/removable") : FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); } diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc index 2dbe58d..f235990 100644 --- a/chromeos/dbus/dbus_thread_manager.cc +++ b/chromeos/dbus/dbus_thread_manager.cc @@ -6,9 +6,9 @@ #include <map> -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/observer_list.h" +#include "base/sys_info.h" #include "base/threading/thread.h" #include "chromeos/chromeos_switches.h" #include "chromeos/dbus/bluetooth_adapter_client.h" @@ -421,7 +421,7 @@ void DBusThreadManager::Initialize() { CHECK(g_dbus_thread_manager == NULL); // Determine whether we use stub or real client implementations. DBusThreadManagerImpl* dbus_thread_manager_impl; - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { dbus_thread_manager_impl = new DBusThreadManagerImpl(REAL_DBUS_CLIENT_IMPLEMENTATION); VLOG(1) << "DBusThreadManager initialized for ChromeOS"; diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 4ff0aca..92637a6 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -9,9 +9,9 @@ #include <X11/extensions/XInput2.h> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" +#include "base/sys_info.h" #include "base/time/time.h" #include "chromeos/display/output_util.h" #include "chromeos/display/real_output_configurator_delegate.h" @@ -224,7 +224,7 @@ OutputConfigurator::OutputConfigurator() : state_controller_(NULL), mirroring_controller_(NULL), is_panel_fitting_enabled_(false), - configure_display_(base::chromeos::IsRunningOnChromeOS()), + configure_display_(base::SysInfo::IsRunningOnChromeOS()), xrandr_event_base_(0), output_state_(STATE_INVALID), power_state_(DISPLAY_POWER_ALL_ON) { diff --git a/chromeos/ime/ibus_daemon_controller.cc b/chromeos/ime/ibus_daemon_controller.cc index ec79904..9fd9ac8 100644 --- a/chromeos/ime/ibus_daemon_controller.cc +++ b/chromeos/ime/ibus_daemon_controller.cc @@ -5,7 +5,6 @@ #include "chromeos/ime/ibus_daemon_controller.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/environment.h" #include "base/files/file_path_watcher.h" #include "base/location.h" diff --git a/chromeos/ime/xkeyboard.cc b/chromeos/ime/xkeyboard.cc index b73a8d1..4c62ffb 100644 --- a/chromeos/ime/xkeyboard.cc +++ b/chromeos/ime/xkeyboard.cc @@ -10,14 +10,14 @@ #include <set> #include <utility> -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" -#include "base/process/process_handle.h" #include "base/process/launch.h" +#include "base/process/process_handle.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "base/threading/thread_checker.h" // These includes conflict with base/tracked_objects.h so must come last. @@ -114,7 +114,7 @@ class XKeyboardImpl : public XKeyboard { }; XKeyboardImpl::XKeyboardImpl() - : is_running_on_chrome_os_(base::chromeos::IsRunningOnChromeOS()) { + : is_running_on_chrome_os_(base::SysInfo::IsRunningOnChromeOS()) { num_lock_mask_ = GetNumLockMask(); // web_input_event_aurax11.cc seems to assume that Mod2Mask is always assigned diff --git a/chromeos/login/login_state.cc b/chromeos/login/login_state.cc index 57a889b..a1f1fbb 100644 --- a/chromeos/login/login_state.cc +++ b/chromeos/login/login_state.cc @@ -4,9 +4,9 @@ #include "chromeos/login/login_state.h" -#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/sys_info.h" #include "chromeos/chromeos_switches.h" namespace chromeos { @@ -17,7 +17,7 @@ namespace { // workstation) and not running as login-manager, pretend like we're always // logged in. bool AlwaysLoggedIn() { - return !base::chromeos::IsRunningOnChromeOS() && + return !base::SysInfo::IsRunningOnChromeOS() && !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager); } diff --git a/chromeos/memory/low_memory_listener.cc b/chromeos/memory/low_memory_listener.cc index abb7f17..fee3101 100644 --- a/chromeos/memory/low_memory_listener.cc +++ b/chromeos/memory/low_memory_listener.cc @@ -7,9 +7,9 @@ #include <fcntl.h> #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" +#include "base/sys_info.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "chromeos/memory/low_memory_listener_delegate.h" @@ -115,7 +115,7 @@ void LowMemoryListenerImpl::StartObservingOnFileThread( file_descriptor_ = ::open(kLowMemFile, O_RDONLY); // Don't report this error unless we're really running on ChromeOS // to avoid testing spam. - if (file_descriptor_ < 0 && base::chromeos::IsRunningOnChromeOS()) { + if (file_descriptor_ < 0 && base::SysInfo::IsRunningOnChromeOS()) { PLOG(ERROR) << "Unable to open " << kLowMemFile; return; } diff --git a/content/browser/aura/image_transport_factory.cc b/content/browser/aura/image_transport_factory.cc index e38ae88..ca83149 100644 --- a/content/browser/aura/image_transport_factory.cc +++ b/content/browser/aura/image_transport_factory.cc @@ -5,16 +5,13 @@ #include "content/browser/aura/image_transport_factory.h" #include "base/command_line.h" +#include "base/sys_info.h" #include "content/browser/aura/gpu_process_transport_factory.h" #include "content/browser/aura/no_transport_image_transport_factory.h" #include "content/public/common/content_switches.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_switches.h" -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace content { namespace { @@ -26,7 +23,7 @@ static bool UseTestContextAndTransportFactory() { #if defined(OS_CHROMEOS) // If the test is running on the chromeos envrionment (such as // device or vm bots), always use real contexts. - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) return false; #endif diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc index dde5176..cb5e3b8 100644 --- a/content/public/test/browser_test_base.cc +++ b/content/public/test/browser_test_base.cc @@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/debug/stack_trace.h" #include "base/message_loop/message_loop.h" +#include "base/sys_info.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" @@ -35,10 +36,6 @@ #include "content/public/browser/browser_thread.h" #endif -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace content { namespace { @@ -188,7 +185,7 @@ void BrowserTestBase::SetUp() { // If the test is running on the chromeos envrionment (such as // device or vm bots), the compositor will use real GL contexts, and // we should use real GL bindings with it. - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) allow_osmesa_ = false; #endif diff --git a/tools/gn/secondary/base/BUILD.gn b/tools/gn/secondary/base/BUILD.gn index 9ef2d8c..5b7cd0e 100644 --- a/tools/gn/secondary/base/BUILD.gn +++ b/tools/gn/secondary/base/BUILD.gn @@ -92,8 +92,6 @@ component("base") { "callback_internal.cc", "callback_internal.h", "cancelable_callback.h", - "chromeos/chromeos_version.cc", - "chromeos/chromeos_version.h", "command_line.cc", "command_line.h", "compiler_specific.h", diff --git a/ui/aura/root_window_host_x11.cc b/ui/aura/root_window_host_x11.cc index 5fce0c7..a6cc378 100644 --- a/ui/aura/root_window_host_x11.cc +++ b/ui/aura/root_window_host_x11.cc @@ -25,6 +25,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/sys_info.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/screen_position_client.h" @@ -45,10 +46,6 @@ #include "ui/events/x/touch_factory_x11.h" #include "ui/gfx/screen.h" -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - using std::max; using std::min; @@ -931,7 +928,7 @@ void RootWindowHostX11::DispatchXI2Event(const base::NativeEvent& event) { } #endif // defined(USE_XI2_MT) #if defined(OS_CHROMEOS) - if (base::chromeos::IsRunningOnChromeOS()) { + if (base::SysInfo::IsRunningOnChromeOS()) { if (!bounds_.Contains(touchev.location())) break; // X maps the touch-surface to the size of the X root-window. diff --git a/ui/base/ime/input_method_ibus.cc b/ui/base/ime/input_method_ibus.cc index 5db106e..e1f4c93 100644 --- a/ui/base/ime/input_method_ibus.cc +++ b/ui/base/ime/input_method_ibus.cc @@ -17,7 +17,6 @@ #include "base/basictypes.h" #include "base/bind.h" -#include "base/chromeos/chromeos_version.h" #include "base/i18n/char_iterator.h" #include "base/logging.h" #include "base/strings/string_util.h" diff --git a/ui/base/ime/input_method_initializer.cc b/ui/base/ime/input_method_initializer.cc index 8c4d34f..f488f4f 100644 --- a/ui/base/ime/input_method_initializer.cc +++ b/ui/base/ime/input_method_initializer.cc @@ -7,7 +7,6 @@ #include "ui/base/ime/input_method_factory.h" #if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/ime/ibus_bridge.h" diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 18815b7..5bcd1af 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -14,6 +14,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/string_util.h" +#include "base/sys_info.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "cc/base/switches.h" @@ -38,10 +39,6 @@ #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" -#if defined(OS_CHROMEOS) -#include "base/chromeos/chromeos_version.h" -#endif - namespace { const double kDefaultRefreshRate = 60.0; @@ -477,7 +474,7 @@ void Compositor::InitializeContextFactoryForTests(bool allow_test_contexts) { #if defined(OS_CHROMEOS) // If the test is running on the chromeos envrionment (such as // device or vm bots), always use real contexts. - if (base::chromeos::IsRunningOnChromeOS()) + if (base::SysInfo::IsRunningOnChromeOS()) use_test_contexts = false; #endif |