From c1dd7bff45b1e8af5605cf015a6dd55a45087116 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Fri, 16 Mar 2012 23:01:02 +0000 Subject: [PATCH] Move IsRunningOnChromeOS to base/chromeos so that ui/, /chromeos and other components can use it. plus, a couple of cleanups including - removed unnecessary includes - removed unnecessary ifdef chromeos in chromeos only code. BUG=115967 TEST=none Review URL: http://codereview.chromium.org/9546013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127283 0039d316-1c4b-4281-b951-d872f2087c98 --- base/base.gypi | 7 +++++ .../chromeos/chromeos_version.cc | 10 +++---- base/chromeos/chromeos_version.h | 21 ++++++++++++++ .../chrome_browser_main_extra_parts_ash.cc | 4 +-- .../chromeos/audio/audio_mixer_alsa.cc | 4 +-- .../chromeos/chrome_browser_main_chromeos.cc | 6 ++-- .../cros/onc_network_parser_unittest.cc | 1 - .../chromeos/dbus/bluetooth_adapter_client.cc | 4 +-- .../dbus/bluetooth_agent_service_provider.cc | 4 +-- .../chromeos/dbus/bluetooth_device_client.cc | 4 +-- .../chromeos/dbus/bluetooth_input_client.cc | 4 +-- .../chromeos/dbus/bluetooth_manager_client.cc | 4 +-- .../chromeos/dbus/bluetooth_node_client.cc | 4 +-- .../chromeos/dbus/cros_dbus_service.cc | 4 +-- .../chromeos/dbus/cros_disks_client.cc | 4 +-- .../chromeos/dbus/cryptohome_client.cc | 4 +-- .../chromeos/dbus/image_burner_client.cc | 4 +-- .../chromeos/dbus/introspectable_client.cc | 4 +-- .../chromeos/dbus/power_manager_client.cc | 4 +-- .../browser/chromeos/dbus/sensors_client.cc | 4 +-- .../chromeos/dbus/session_manager_client.cc | 4 +-- .../dbus/speech_synthesizer_client.cc | 4 +-- .../chromeos/dbus/update_engine_client.cc | 4 +-- chrome/browser/chromeos/frame/browser_view.cc | 4 +-- .../chromeos/input_method/xkeyboard.cc | 5 ++-- .../chromeos/login/user_manager_impl.cc | 4 +-- .../chromeos/login/version_info_updater.cc | 6 ++-- .../chromeos/login/wizard_controller.cc | 4 +-- chrome/browser/chromeos/preferences.cc | 4 +-- .../chromeos/status/caps_lock_menu_button.cc | 6 ++-- .../chromeos/status/volume_menu_button.cc | 1 - .../chromeos/system/input_device_settings.cc | 4 +-- .../chromeos/system/runtime_environment.h | 21 -------------- .../chromeos/system/screen_locker_settings.cc | 6 ++-- .../chromeos/system/statistics_provider.cc | 5 ++-- .../chromeos/system/timezone_settings.cc | 6 ++-- .../api/terminal/terminal_private_api.cc | 4 +-- chrome/browser/low_memory_observer.cc | 5 ++-- chrome/browser/ui/browser_list.cc | 4 +-- .../browser/ui/views/ash/caps_lock_handler.cc | 5 ++-- .../ui/views/ash/status_area_host_aura.cc | 4 +-- .../ash/status_area_host_aura_browsertest.cc | 4 +-- .../browser/ui/views/frame/browser_frame.cc | 3 +- .../ui/webui/chromeos/register_page_ui.cc | 29 ++----------------- chrome/browser/ui/webui/flags_ui.cc | 4 +-- .../chromeos/bluetooth_options_handler.cc | 1 - .../chromeos/bluetooth_options_handler2.cc | 1 - chrome/chrome_browser.gypi | 2 -- 48 files changed, 117 insertions(+), 142 deletions(-) rename chrome/browser/chromeos/system/runtime_environment.cc => base/chromeos/chromeos_version.cc (67%) create mode 100644 base/chromeos/chromeos_version.h delete mode 100644 chrome/browser/chromeos/system/runtime_environment.h diff --git a/base/base.gypi b/base/base.gypi index c4df5b7e5eb..0c556f19855 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -62,6 +62,8 @@ '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', @@ -549,6 +551,11 @@ ['exclude', '^sys_info_linux\\.cc$'], ], }], + [ 'chromeos != 1', { + 'sources/': [ + ['exclude', '^chromeos/'], + ], + }], ], }], ], diff --git a/chrome/browser/chromeos/system/runtime_environment.cc b/base/chromeos/chromeos_version.cc similarity index 67% rename from chrome/browser/chromeos/system/runtime_environment.cc rename to base/chromeos/chromeos_version.cc index e85eb8241af..4a70cd5312a 100644 --- a/chrome/browser/chromeos/system/runtime_environment.cc +++ b/base/chromeos/chromeos_version.cc @@ -1,17 +1,16 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/browser/chromeos/system/runtime_environment.h" +#include "base/chromeos/chromeos_version.h" #include #include #include "base/logging.h" +namespace base { namespace chromeos { -namespace system { -namespace runtime_environment { bool IsRunningOnChromeOS() { // Check if the user name is chronos. Note that we don't go with @@ -21,6 +20,5 @@ bool IsRunningOnChromeOS() { return user && strcmp(user, "chronos") == 0; } -} // namespace runtime_environment -} // namespace system } // namespace chromeos +} // namespace base diff --git a/base/chromeos/chromeos_version.h b/base/chromeos/chromeos_version.h new file mode 100644 index 00000000000..fc4b242b323 --- /dev/null +++ b/base/chromeos/chromeos_version.h @@ -0,0 +1,21 @@ +// 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_ +#pragma once + +#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/chrome/browser/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/chrome_browser_main_extra_parts_ash.cc index 22dc56588c8..563adb14d3e 100644 --- a/chrome/browser/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/chrome_browser_main_extra_parts_ash.cc @@ -20,12 +20,12 @@ #include "ui/gfx/compositor/compositor_setup.h" #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" #include "chrome/browser/chromeos/input_method/input_method_manager.h" #include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #endif ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() @@ -34,7 +34,7 @@ ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { #if defined(OS_CHROMEOS) - if (chromeos::system::runtime_environment::IsRunningOnChromeOS() || + if (base::chromeos::IsRunningOnChromeOS() || CommandLine::ForCurrentProcess()->HasSwitch( switches::kAuraHostWindowUseFullscreen)) { aura::RootWindow::set_use_fullscreen_host_window(true); diff --git a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc index f84f6e559d2..05dc5277f3f 100644 --- a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc +++ b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc @@ -13,11 +13,11 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/extensions/extension_tts_api_chromeos.h" #include "content/public/browser/browser_thread.h" @@ -151,7 +151,7 @@ void AudioMixerAlsa::Connect() { return; // Do not attempt to connect if we're not on the device. - if (!system::runtime_environment::IsRunningOnChromeOS()) + if (!base::chromeos::IsRunningOnChromeOS()) return; if (!ConnectInternal()) { diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 7ca0181660d..f65b0814606 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/message_loop.h" @@ -38,7 +39,6 @@ #include "chrome/browser/chromeos/power/resume_observer.h" #include "chrome/browser/chromeos/power/screen_lock_observer.h" #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/chromeos/system_key_event_listener.h" #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" @@ -306,7 +306,7 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { // detector starts to monitor changes from the update engine. UpgradeDetectorChromeos::GetInstance()->Init(); - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { // Enable Num Lock on X start up for http://crosbug.com/p/5795 and // http://crosbug.com/p/6245. We don't do this for Chromium OS since many // netbooks do not work as intended when Num Lock is on (e.g. On a netbook @@ -336,7 +336,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 (chromeos::system::runtime_environment::IsRunningOnChromeOS() && + if (base::chromeos::IsRunningOnChromeOS() && !parameters().ui_task) { // ui_task is non-NULL when running tests. chromeos::SystemKeyEventListener::Initialize(); } diff --git a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc index c71e92369a7..5a98802e1bf 100644 --- a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc +++ b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc @@ -21,7 +21,6 @@ #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" #include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_browser_process.h" diff --git a/chrome/browser/chromeos/dbus/bluetooth_adapter_client.cc b/chrome/browser/chromeos/dbus/bluetooth_adapter_client.cc index 97f075f580f..b7d2d11d4c0 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_adapter_client.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_adapter_client.cc @@ -7,12 +7,12 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/stl_util.h" #include "chrome/browser/chromeos/dbus/bluetooth_device_client.h" #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" #include "chrome/browser/chromeos/dbus/bluetooth_property.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -800,7 +800,7 @@ BluetoothAdapterClient::~BluetoothAdapterClient() { BluetoothAdapterClient* BluetoothAdapterClient::Create( dbus::Bus* bus, BluetoothManagerClient* manager_client) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothAdapterClientImpl(bus, manager_client); } else { return new BluetoothAdapterClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc b/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc index 505a6f425be..f686097ec3a 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_agent_service_provider.cc @@ -7,10 +7,10 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/threading/platform_thread.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/exported_object.h" #include "dbus/message.h" @@ -558,7 +558,7 @@ BluetoothAgentServiceProvider* BluetoothAgentServiceProvider::Create( dbus::Bus* bus, const dbus::ObjectPath& object_path, Delegate* delegate) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothAgentServiceProviderImpl(bus, object_path, delegate); } else { return new BluetoothAgentServiceProviderStubImpl(delegate); diff --git a/chrome/browser/chromeos/dbus/bluetooth_device_client.cc b/chrome/browser/chromeos/dbus/bluetooth_device_client.cc index 6c9fe7d10ae..a1700016243 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_device_client.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_device_client.cc @@ -7,11 +7,11 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/stl_util.h" #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" #include "chrome/browser/chromeos/dbus/bluetooth_property.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -530,7 +530,7 @@ BluetoothDeviceClient::~BluetoothDeviceClient() { BluetoothDeviceClient* BluetoothDeviceClient::Create( dbus::Bus* bus, BluetoothAdapterClient* adapter_client) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothDeviceClientImpl(bus, adapter_client); } else { return new BluetoothDeviceClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/bluetooth_input_client.cc b/chrome/browser/chromeos/dbus/bluetooth_input_client.cc index ce8e6411c00..61d62260df3 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_input_client.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_input_client.cc @@ -7,11 +7,11 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/stl_util.h" #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" #include "chrome/browser/chromeos/dbus/bluetooth_property.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -255,7 +255,7 @@ BluetoothInputClient::~BluetoothInputClient() { BluetoothInputClient* BluetoothInputClient::Create( dbus::Bus* bus, BluetoothAdapterClient* adapter_client) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothInputClientImpl(bus, adapter_client); } else { return new BluetoothInputClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc b/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc index 76142c834cc..7386c795583 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc @@ -5,9 +5,9 @@ #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "chrome/browser/chromeos/dbus/bluetooth_property.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -306,7 +306,7 @@ BluetoothManagerClient::~BluetoothManagerClient() { } BluetoothManagerClient* BluetoothManagerClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothManagerClientImpl(bus); } else { return new BluetoothManagerClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/bluetooth_node_client.cc b/chrome/browser/chromeos/dbus/bluetooth_node_client.cc index ee74034ecad..07521aa9b56 100644 --- a/chrome/browser/chromeos/dbus/bluetooth_node_client.cc +++ b/chrome/browser/chromeos/dbus/bluetooth_node_client.cc @@ -7,11 +7,11 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/stl_util.h" #include "chrome/browser/chromeos/dbus/bluetooth_device_client.h" #include "chrome/browser/chromeos/dbus/bluetooth_property.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -192,7 +192,7 @@ BluetoothNodeClient::~BluetoothNodeClient() { BluetoothNodeClient* BluetoothNodeClient::Create( dbus::Bus* bus, BluetoothDeviceClient* adapter_client) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new BluetoothNodeClientImpl(bus, adapter_client); } else { return new BluetoothNodeClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/cros_dbus_service.cc b/chrome/browser/chromeos/dbus/cros_dbus_service.cc index 8552aca9b08..9954ed4f86a 100644 --- a/chrome/browser/chromeos/dbus/cros_dbus_service.cc +++ b/chrome/browser/chromeos/dbus/cros_dbus_service.cc @@ -5,10 +5,10 @@ #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/threading/platform_thread.h" #include "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" #include "dbus/bus.h" #include "dbus/exported_object.h" @@ -99,7 +99,7 @@ class CrosDBusServiceStubImpl : public CrosDBusService { // static CrosDBusService* CrosDBusService::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { CrosDBusServiceImpl* service = new CrosDBusServiceImpl(bus); service->RegisterServiceProvider(ProxyResolutionServiceProvider::Create()); return service; diff --git a/chrome/browser/chromeos/dbus/cros_disks_client.cc b/chrome/browser/chromeos/dbus/cros_disks_client.cc index 210a71d1739..23dfe9f5113 100644 --- a/chrome/browser/chromeos/dbus/cros_disks_client.cc +++ b/chrome/browser/chromeos/dbus/cros_disks_client.cc @@ -5,8 +5,8 @@ #include "chrome/browser/chromeos/dbus/cros_disks_client.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/stl_util.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -557,7 +557,7 @@ CrosDisksClient::~CrosDisksClient() {} // static CrosDisksClient* CrosDisksClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) + if (base::chromeos::IsRunningOnChromeOS()) return new CrosDisksClientImpl(bus); else return new CrosDisksClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/cryptohome_client.cc b/chrome/browser/chromeos/dbus/cryptohome_client.cc index d2345030d30..d0b3e9b7445 100644 --- a/chrome/browser/chromeos/dbus/cryptohome_client.cc +++ b/chrome/browser/chromeos/dbus/cryptohome_client.cc @@ -5,8 +5,8 @@ #include "chrome/browser/chromeos/dbus/cryptohome_client.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" #include "dbus/bus.h" #include "dbus/message.h" @@ -657,7 +657,7 @@ CryptohomeClient::~CryptohomeClient() {} // static CryptohomeClient* CryptohomeClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) + if (base::chromeos::IsRunningOnChromeOS()) return new CryptohomeClientImpl(bus); else return new CryptohomeClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/image_burner_client.cc b/chrome/browser/chromeos/dbus/image_burner_client.cc index 49ea93f8510..776f7ecdf82 100644 --- a/chrome/browser/chromeos/dbus/image_burner_client.cc +++ b/chrome/browser/chromeos/dbus/image_burner_client.cc @@ -5,8 +5,8 @@ #include "chrome/browser/chromeos/dbus/image_burner_client.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/compiler_specific.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -157,7 +157,7 @@ ImageBurnerClient::~ImageBurnerClient() { // static ImageBurnerClient* ImageBurnerClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new ImageBurnerClientImpl(bus); } else { return new ImageBurnerClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/introspectable_client.cc b/chrome/browser/chromeos/dbus/introspectable_client.cc index 6e80c0d09bf..508e1da20ff 100644 --- a/chrome/browser/chromeos/dbus/introspectable_client.cc +++ b/chrome/browser/chromeos/dbus/introspectable_client.cc @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/logging.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" +#include "base/chromeos/chromeos_version.h" #include "chrome/common/libxml_utils.h" #include "dbus/bus.h" #include "dbus/message.h" @@ -144,7 +144,7 @@ std::vector IntrospectableClient::GetInterfacesFromXmlData( // static IntrospectableClient* IntrospectableClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new IntrospectableClientImpl(bus); } else { return new IntrospectableClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/power_manager_client.cc b/chrome/browser/chromeos/dbus/power_manager_client.cc index 2963fadbccc..0021f2db35d 100644 --- a/chrome/browser/chromeos/dbus/power_manager_client.cc +++ b/chrome/browser/chromeos/dbus/power_manager_client.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/chromeos/chromeos_version.h" #include "base/format_macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" @@ -16,7 +17,6 @@ #include "base/timer.h" #include "chrome/browser/chromeos/dbus/power_supply_properties.pb.h" #include "chrome/browser/chromeos/login/screen_locker.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -537,7 +537,7 @@ PowerManagerClient::~PowerManagerClient() { } PowerManagerClient* PowerManagerClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new PowerManagerClientImpl(bus); } else { return new PowerManagerClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/sensors_client.cc b/chrome/browser/chromeos/dbus/sensors_client.cc index f8c03f4aa89..cff26c593a4 100644 --- a/chrome/browser/chromeos/dbus/sensors_client.cc +++ b/chrome/browser/chromeos/dbus/sensors_client.cc @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/callback.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" +#include "base/chromeos/chromeos_version.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/sensors_provider.h" #include "dbus/bus.h" @@ -94,7 +94,7 @@ SensorsClient::~SensorsClient() { } SensorsClient* SensorsClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new SensorsClientImpl(bus); } else { return new SensorsClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/session_manager_client.cc b/chrome/browser/chromeos/dbus/session_manager_client.cc index a4b35792d23..d6693635083 100644 --- a/chrome/browser/chromeos/dbus/session_manager_client.cc +++ b/chrome/browser/chromeos/dbus/session_manager_client.cc @@ -6,8 +6,8 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/chromeos/chromeos_version.h" #include "base/string_util.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -311,7 +311,7 @@ SessionManagerClient::~SessionManagerClient() { } SessionManagerClient* SessionManagerClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new SessionManagerClientImpl(bus); } else { return new SessionManagerClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/speech_synthesizer_client.cc b/chrome/browser/chromeos/dbus/speech_synthesizer_client.cc index 5c474c8b35b..b4e89ffcb26 100644 --- a/chrome/browser/chromeos/dbus/speech_synthesizer_client.cc +++ b/chrome/browser/chromeos/dbus/speech_synthesizer_client.cc @@ -5,8 +5,8 @@ #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/compiler_specific.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -126,7 +126,7 @@ SpeechSynthesizerClient::~SpeechSynthesizerClient() { // static SpeechSynthesizerClient* SpeechSynthesizerClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new SpeechSynthesizerClientImpl(bus); } else { return new SpeechSynthesizerClientStubImpl(); diff --git a/chrome/browser/chromeos/dbus/update_engine_client.cc b/chrome/browser/chromeos/dbus/update_engine_client.cc index d879235bd2a..8949b4c036f 100644 --- a/chrome/browser/chromeos/dbus/update_engine_client.cc +++ b/chrome/browser/chromeos/dbus/update_engine_client.cc @@ -6,8 +6,8 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/chromeos/chromeos_version.h" #include "base/string_util.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "dbus/bus.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -280,7 +280,7 @@ UpdateEngineClient::EmptyUpdateCheckCallback() { // static UpdateEngineClient* UpdateEngineClient::Create(dbus::Bus* bus) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return new UpdateEngineClientImpl(bus); } else { return new UpdateEngineClientStubImpl(); diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc index 3a020b796de..a0d0eab5e26 100644 --- a/chrome/browser/chromeos/frame/browser_view.cc +++ b/chrome/browser/chromeos/frame/browser_view.cc @@ -9,6 +9,7 @@ #include #include +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/chromeos/frame/layout_mode_button.h" @@ -17,7 +18,6 @@ #include "chrome/browser/chromeos/status/network_menu_button.h" #include "chrome/browser/chromeos/status/status_area_button.h" #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/gtk/gtk_util.h" @@ -427,7 +427,7 @@ void BrowserView::ChildPreferredSizeChanged(View* child) { bool BrowserView::GetSavedWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const { - if (system::runtime_environment::IsRunningOnChromeOS() || + if (base::chromeos::IsRunningOnChromeOS() || CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) { // Typically we don't request a full screen size. This means we'll request a // non-full screen size, layout/paint at that size, then the window manager diff --git a/chrome/browser/chromeos/input_method/xkeyboard.cc b/chrome/browser/chromeos/input_method/xkeyboard.cc index 4033be2dbef..361246ab634 100644 --- a/chrome/browser/chromeos/input_method/xkeyboard.cc +++ b/chrome/browser/chromeos/input_method/xkeyboard.cc @@ -10,6 +10,7 @@ #include #include +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/process_util.h" @@ -17,7 +18,6 @@ #include "base/stringprintf.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/input_method/xkeyboard_data.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" #include "ui/base/x/x11_util.h" @@ -127,8 +127,7 @@ class XKeyboardImpl : public XKeyboard { }; XKeyboardImpl::XKeyboardImpl(const InputMethodUtil& util) - : is_running_on_chrome_os_( - system::runtime_environment::IsRunningOnChromeOS()) { + : is_running_on_chrome_os_(base::chromeos::IsRunningOnChromeOS()) { num_lock_mask_ = GetNumLockMask(); #if defined(USE_AURA) diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc index 895ee7bfba3..372c2387ca3 100644 --- a/chrome/browser/chromeos/login/user_manager_impl.cc +++ b/chrome/browser/chromeos/login/user_manager_impl.cc @@ -10,6 +10,7 @@ #include "ash/desktop_background/desktop_background_controller.h" #include "ash/desktop_background/desktop_background_resources.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/file_path.h" @@ -37,7 +38,6 @@ #include "chrome/browser/chromeos/login/login_display.h" #include "chrome/browser/chromeos/login/ownership_service.h" #include "chrome/browser/chromeos/login/remove_user_delegate.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/policy/browser_policy_connector.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" @@ -301,7 +301,7 @@ UserManagerImpl::UserManagerImpl() last_image_set_async_(false), downloaded_profile_image_data_url_(chrome::kAboutBlankURL) { // Use stub as the logged-in user for test paths without login. - if (!system::runtime_environment::IsRunningOnChromeOS()) + if (!base::chromeos::IsRunningOnChromeOS()) StubUserLoggedIn(); registrar_.Add(this, chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, content::NotificationService::AllSources()); diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc index e4968c0710c..06c05c271b3 100644 --- a/chrome/browser/chromeos/login/version_info_updater.cc +++ b/chrome/browser/chromeos/login/version_info_updater.cc @@ -9,13 +9,13 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/chromeos/chromeos_version.h" #include "base/string16.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/cros/cros_library.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/policy/browser_policy_connector.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/chrome_version_info.h" @@ -44,7 +44,7 @@ VersionInfoUpdater::~VersionInfoUpdater() { } void VersionInfoUpdater::StartUpdate(bool is_official_build) { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { version_loader_.GetVersion( &version_consumer_, base::Bind(&VersionInfoUpdater::OnVersion, base::Unretained(this)), @@ -84,7 +84,7 @@ void VersionInfoUpdater::UpdateVersionLabel() { const char *kAuraSuffix = " Aura"; #endif - if (!system::runtime_environment::IsRunningOnChromeOS()) { + if (!base::chromeos::IsRunningOnChromeOS()) { if (delegate_) { delegate_->OnOSVersionLabelTextUpdated( CrosLibrary::Get()->load_error_string()); diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index a270d1dc054..ffedaf0120e 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -12,6 +12,7 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" @@ -38,7 +39,6 @@ #include "chrome/browser/chromeos/login/update_screen.h" #include "chrome/browser/chromeos/login/user_image_screen.h" #include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/options/options_util.h" @@ -594,7 +594,7 @@ static FilePath GetOobeCompleteFlagPath() { // The constant is defined here so it won't be referenced directly. const char kOobeCompleteFlagFilePath[] = "/home/chronos/.oobe_completed"; - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return FilePath(kOobeCompleteFlagFilePath); } else { const char* home = getenv("HOME"); diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 0d2bd33999e..464171004c2 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -4,6 +4,7 @@ #include "chrome/browser/chromeos/preferences.h" +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/i18n/time_formatting.h" #include "base/metrics/histogram.h" @@ -16,7 +17,6 @@ #include "chrome/browser/chromeos/input_method/xkeyboard.h" #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/chromeos/system/input_device_settings.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/chromeos/system/screen_locker_settings.h" #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/prefs/pref_member.h" @@ -590,7 +590,7 @@ void Preferences::UpdateModifierKeyMapping() { void Preferences::UpdateAutoRepeatRate() { // Avoid setting repeat rate on desktop dev environment. - if (!system::runtime_environment::IsRunningOnChromeOS()) + if (!base::chromeos::IsRunningOnChromeOS()) return; input_method::AutoRepeatRate rate; diff --git a/chrome/browser/chromeos/status/caps_lock_menu_button.cc b/chrome/browser/chromeos/status/caps_lock_menu_button.cc index cd22109bbdf..3d69e9206d1 100644 --- a/chrome/browser/chromeos/status/caps_lock_menu_button.cc +++ b/chrome/browser/chromeos/status/caps_lock_menu_button.cc @@ -6,13 +6,13 @@ #include +#include "base/chromeos/chromeos_version.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/input_method/input_method_manager.h" #include "chrome/browser/chromeos/input_method/xkeyboard.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/status/status_area_bubble.h" #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/chromeos/view_ids.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile_manager.h" @@ -79,7 +79,7 @@ CapsLockMenuButton::CapsLockMenuButton(StatusAreaButton::Delegate* delegate) // device. SystemKeyEventListener is never initialized on chrome for cros // running on linux. DCHECK(SystemKeyEventListener::GetInstance() || - !system::runtime_environment::IsRunningOnChromeOS()); + !base::chromeos::IsRunningOnChromeOS()); if (SystemKeyEventListener::GetInstance()) SystemKeyEventListener::GetInstance()->AddCapsLockObserver(this); @@ -268,7 +268,7 @@ void CapsLockMenuButton::HideBubble() { bool CapsLockMenuButton::HasCapsLock() const { // A keyboard for Linux usually has Caps Lock. - if (!system::runtime_environment::IsRunningOnChromeOS()) + if (!base::chromeos::IsRunningOnChromeOS()) return true; // On the login screen, Caps Lock is not available. if (!initialized_prefs_) diff --git a/chrome/browser/chromeos/status/volume_menu_button.cc b/chrome/browser/chromeos/status/volume_menu_button.cc index 6ff7622fd41..e67295eb200 100644 --- a/chrome/browser/chromeos/status/volume_menu_button.cc +++ b/chrome/browser/chromeos/status/volume_menu_button.cc @@ -9,7 +9,6 @@ #include "base/command_line.h" #include "base/string_number_conversions.h" #include "chrome/browser/chromeos/status/status_area_bubble.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/chromeos/view_ids.h" #include "chrome/common/chrome_switches.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc index d5b4e4231c7..a099b31f208 100644 --- a/chrome/browser/chromeos/system/input_device_settings.cc +++ b/chrome/browser/chromeos/system/input_device_settings.cc @@ -9,13 +9,13 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/message_loop.h" #include "base/process_util.h" #include "base/stringprintf.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; @@ -38,7 +38,7 @@ void ExecuteScriptOnFileThread(const std::vector& argv) { const std::string& script(argv[0]); // Script must exist on device. - DCHECK(!runtime_environment::IsRunningOnChromeOS() || ScriptExists(script)); + DCHECK(!base::chromeos::IsRunningOnChromeOS() || ScriptExists(script)); if (!ScriptExists(script)) return; diff --git a/chrome/browser/chromeos/system/runtime_environment.h b/chrome/browser/chromeos/system/runtime_environment.h deleted file mode 100644 index 3583230e7b7..00000000000 --- a/chrome/browser/chromeos/system/runtime_environment.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_SYSTEM_RUNTIME_ENVIRONMENT_H_ -#define CHROME_BROWSER_CHROMEOS_SYSTEM_RUNTIME_ENVIRONMENT_H_ -#pragma once - -namespace chromeos { -namespace system { -namespace runtime_environment { - -// Returns true if the browser is running on Chrome OS. -// Useful for implementing stubs for Linux desktop. -bool IsRunningOnChromeOS(); - -} // namespace runtime_environment -} // namespace system -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_RUNTIME_ENVIRONMENT_H_ diff --git a/chrome/browser/chromeos/system/screen_locker_settings.cc b/chrome/browser/chromeos/system/screen_locker_settings.cc index a0253c32011..728b418c4da 100644 --- a/chrome/browser/chromeos/system/screen_locker_settings.cc +++ b/chrome/browser/chromeos/system/screen_locker_settings.cc @@ -1,14 +1,14 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/browser/chromeos/system/screen_locker_settings.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/stringprintf.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; @@ -21,7 +21,7 @@ const char kLockOnIdleSuspendPath[] = void EnableScreenLockOnFileThread(bool enable) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { std::string config = base::StringPrintf("%d", enable); file_util::WriteFile(FilePath(kLockOnIdleSuspendPath), config.c_str(), diff --git a/chrome/browser/chromeos/system/statistics_provider.cc b/chrome/browser/chromeos/system/statistics_provider.cc index aec7315eb2a..a73aa973287 100644 --- a/chrome/browser/chromeos/system/statistics_provider.cc +++ b/chrome/browser/chromeos/system/statistics_provider.cc @@ -5,14 +5,15 @@ #include "chrome/browser/chromeos/system/statistics_provider.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" #include "base/memory/singleton.h" #include "base/synchronization/waitable_event.h" #include "base/time.h" +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/chromeos/system/name_value_pairs_parser.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/chrome_version_info.h" #include "content/public/browser/browser_thread.h" @@ -209,7 +210,7 @@ class StatisticsProviderStubImpl : public StatisticsProvider { }; StatisticsProvider* StatisticsProvider::GetInstance() { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::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 414463f660c..d5c505458c5 100644 --- a/chrome/browser/chromeos/system/timezone_settings.cc +++ b/chrome/browser/chromeos/system/timezone_settings.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/browser/chromeos/system/timezone_settings.h" #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" @@ -13,7 +14,6 @@ #include "base/observer_list.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; @@ -203,7 +203,7 @@ class TimezoneSettingsStubImpl : public TimezoneSettings { }; TimezoneSettings* TimezoneSettings::GetInstance() { - if (system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return TimezoneSettingsImpl::GetInstance(); } else { return TimezoneSettingsStubImpl::GetInstance(); diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc index 604c9399c09..4bde458979c 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc @@ -5,10 +5,10 @@ #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/values.h" #include "chrome/browser/chromeos/process_proxy/process_proxy_registry.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" #include "chrome/browser/extensions/extension_event_names.h" #include "chrome/browser/extensions/extension_event_router.h" @@ -24,7 +24,7 @@ const char kCroshCommand[] = "/usr/bin/crosh"; const char kStubbedCroshCommand[] = "cat"; const char* GetCroshPath() { - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) + if (base::chromeos::IsRunningOnChromeOS()) return kCroshCommand; else return kStubbedCroshCommand; diff --git a/chrome/browser/low_memory_observer.cc b/chrome/browser/low_memory_observer.cc index 106d8639df4..b4e408df989 100644 --- a/chrome/browser/low_memory_observer.cc +++ b/chrome/browser/low_memory_observer.cc @@ -7,12 +7,12 @@ #include #include "base/bind.h" +#include "base/chromeos/chromeos_version.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/time.h" #include "base/timer.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/oom_priority_manager.h" #include "content/public/browser/browser_thread.h" @@ -115,8 +115,7 @@ void LowMemoryObserverImpl::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 && - chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (file_descriptor_ < 0 && base::chromeos::IsRunningOnChromeOS()) { PLOG(ERROR) << "Unable to open " << kLowMemFile; return; } diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index 5e2bfd501c2..b7106e13351 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc @@ -35,11 +35,11 @@ #endif #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" #include "chrome/browser/chromeos/dbus/session_manager_client.h" #include "chrome/browser/chromeos/dbus/update_engine_client.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #if defined(TOOLKIT_USES_GTK) #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" #endif @@ -338,7 +338,7 @@ void BrowserList::NotifyAndTerminate(bool fast_path) { #if defined(OS_CHROMEOS) NotifyWindowManagerAboutSignout(); - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::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/ui/views/ash/caps_lock_handler.cc b/chrome/browser/ui/views/ash/caps_lock_handler.cc index 6b4115cc647..ab81dd7f73b 100644 --- a/chrome/browser/ui/views/ash/caps_lock_handler.cc +++ b/chrome/browser/ui/views/ash/caps_lock_handler.cc @@ -9,9 +9,9 @@ // TODO(yusukes): Support Ash on Windows. #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/input_method/xkeyboard.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/pref_names.h" #endif @@ -19,8 +19,7 @@ #if defined(OS_CHROMEOS) CapsLockHandler::CapsLockHandler(chromeos::input_method::XKeyboard* xkeyboard) : xkeyboard_(xkeyboard), - is_running_on_chromeos_( - chromeos::system::runtime_environment::IsRunningOnChromeOS()), + is_running_on_chromeos_(base::chromeos::IsRunningOnChromeOS()), caps_lock_is_on_(xkeyboard_->CapsLockIsEnabled()) { chromeos::SystemKeyEventListener* system_event_listener = chromeos::SystemKeyEventListener::GetInstance(); diff --git a/chrome/browser/ui/views/ash/status_area_host_aura.cc b/chrome/browser/ui/views/ash/status_area_host_aura.cc index 8efe79daff5..d6f0d84ab3e 100644 --- a/chrome/browser/ui/views/ash/status_area_host_aura.cc +++ b/chrome/browser/ui/views/ash/status_area_host_aura.cc @@ -22,13 +22,13 @@ #include "ui/views/widget/widget.h" #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/chromeos/login/base_login_display_host.h" #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/status/clock_updater.h" #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "ui/gfx/native_widget_types.h" #endif @@ -213,7 +213,7 @@ void StatusAreaHostAura::Observe(int type, bool StatusAreaHostAura::IsLoginOrLockScreenDisplayed() const { #if defined(OS_CHROMEOS) if (!chromeos::UserManager::Get()->IsUserLoggedIn() && - chromeos::system::runtime_environment::IsRunningOnChromeOS()) + base::chromeos::IsRunningOnChromeOS()) return true; const chromeos::ScreenLocker* locker = diff --git a/chrome/browser/ui/views/ash/status_area_host_aura_browsertest.cc b/chrome/browser/ui/views/ash/status_area_host_aura_browsertest.cc index 65acd1ee806..797fd9a38a2 100644 --- a/chrome/browser/ui/views/ash/status_area_host_aura_browsertest.cc +++ b/chrome/browser/ui/views/ash/status_area_host_aura_browsertest.cc @@ -7,7 +7,6 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/chromeos/status/status_area_button.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" @@ -20,6 +19,7 @@ #include "ui/gfx/size.h" #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/login/screen_locker_tester.h" #include "chrome/browser/chromeos/login/user_manager.h" @@ -34,7 +34,7 @@ IN_PROC_BROWSER_TEST_F(StatusAreaHostAuraTest, TextStyle) { #if defined(OS_CHROMEOS) ASSERT_FALSE(chromeos::UserManager::Get()->IsUserLoggedIn()); - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { EXPECT_EQ(StatusAreaButton::GRAY_PLAIN_LIGHT, host->GetStatusAreaTextStyle()); } else { diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 7ab625d5277..ccc3479459c 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/frame/browser_frame.h" #include "base/i18n/rtl.h" +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser.h" @@ -101,7 +102,7 @@ void BrowserFrame::TabStripDisplayModeChanged() { bool BrowserFrame::IsMaximized() const { #if defined(OS_CHROMEOS) && !defined(USE_AURA) - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { return !IsFullscreen() && (browser_view_->IsBrowserTypeNormal() || Widget::IsMaximized()); } diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc index b98940ffc02..9959ed1659e 100644 --- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc +++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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. @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/chromeos/chromeos_version.h" #include "base/logging.h" #include "base/memory/weak_ptr.h" #include "base/string_piece.h" @@ -18,7 +19,6 @@ #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/chromeos/customization_document.h" #include "chrome/browser/chromeos/login/wizard_controller.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/chromeos/version_loader.h" #include "chrome/browser/profiles/profile.h" @@ -66,7 +66,6 @@ const char kUndefinedValue[] = "undefined"; // If there's no interface that's connected, interface that's in connecting // state is considered as the active one. // Otherwise |kUndefinedValue| is returned. -#if defined(OS_CHROMEOS) static std::string GetConnectionType() { chromeos::NetworkLibrary* network_lib = chromeos::CrosLibrary::Get()->GetNetworkLibrary(); @@ -86,7 +85,6 @@ static std::string GetConnectionType() { else return kUndefinedValue; } -#endif } // namespace @@ -124,10 +122,8 @@ class RegisterPageHandler : public WebUIMessageHandler, void HandleGetRegistrationUrl(const ListValue* args); void HandleGetUserInfo(const ListValue* args); -#if defined(OS_CHROMEOS) // Callback from chromeos::VersionLoader giving the version. void OnVersion(chromeos::VersionLoader::Handle handle, std::string version); -#endif // Skips registration logging |error_msg| with log type ERROR. void SkipRegistration(const std::string& error_msg); @@ -135,10 +131,8 @@ class RegisterPageHandler : public WebUIMessageHandler, // Sends message to host registration page with system/user info data. void SendUserInfo(); -#if defined(OS_CHROMEOS) // Handles asynchronously loading the version. chromeos::VersionLoader version_loader_; -#endif // Used to request the version. CancelableRequestConsumer version_consumer_; @@ -163,7 +157,6 @@ void RegisterPageUIHTMLSource::StartDataRequest(const std::string& path, int request_id) { // Make sure that chrome://register is available only during // OOBE wizard lifetime and when device has not been registered yet. -#if defined(OS_CHROMEOS) if (!chromeos::WizardController::default_controller() || chromeos::WizardController::IsDeviceRegistered()) { scoped_refptr empty_bytes(new RefCountedBytes); @@ -176,10 +169,6 @@ void RegisterPageUIHTMLSource::StartDataRequest(const std::string& path, IDR_HOST_REGISTRATION_PAGE_HTML)); SendResponse(request_id, html_bytes); -#else - scoped_refptr empty_bytes(new RefCountedBytes); - SendResponse(request_id, empty_bytes); -#endif } //////////////////////////////////////////////////////////////////////////////// @@ -194,18 +183,15 @@ RegisterPageHandler::~RegisterPageHandler() { } void RegisterPageHandler::RegisterMessages() { -#if defined(OS_CHROMEOS) web_ui()->RegisterMessageCallback(kJsCallbackGetRegistrationUrl, base::Bind(&RegisterPageHandler::HandleGetRegistrationUrl, base::Unretained(this))); web_ui()->RegisterMessageCallback(kJsCallbackUserInfo, base::Bind(&RegisterPageHandler::HandleGetUserInfo, base::Unretained(this))); -#endif } void RegisterPageHandler::HandleGetRegistrationUrl(const ListValue* args) { -#if defined(OS_CHROMEOS) chromeos::StartupCustomizationDocument* customization = chromeos::StartupCustomizationDocument::GetInstance(); if (chromeos::WizardController::default_controller() && @@ -222,12 +208,10 @@ void RegisterPageHandler::HandleGetRegistrationUrl(const ListValue* args) { } else { SkipRegistration("Startup manifest not defined."); } -#endif } void RegisterPageHandler::HandleGetUserInfo(const ListValue* args) { -#if defined(OS_CHROMEOS) - if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { + if (base::chromeos::IsRunningOnChromeOS()) { version_loader_.GetVersion( &version_consumer_, base::Bind(&RegisterPageHandler::OnVersion, base::Unretained(this)), @@ -235,29 +219,23 @@ void RegisterPageHandler::HandleGetUserInfo(const ListValue* args) { } else { SkipRegistration("Not running on ChromeOS."); } -#endif } -#if defined(OS_CHROMEOS) void RegisterPageHandler::OnVersion(chromeos::VersionLoader::Handle handle, std::string version) { version_ = version; SendUserInfo(); } -#endif void RegisterPageHandler::SkipRegistration(const std::string& error_msg) { -#if defined(OS_CHROMEOS) LOG(ERROR) << error_msg; if (chromeos::WizardController::default_controller()) chromeos::WizardController::default_controller()->SkipRegistration(); else web_ui()->CallJavascriptFunction(kJsApiSkipRegistration); -#endif } void RegisterPageHandler::SendUserInfo() { -#if defined(OS_CHROMEOS) DictionaryValue value; chromeos::system::StatisticsProvider * provider = @@ -286,7 +264,6 @@ void RegisterPageHandler::SendUserInfo() { value.SetString("user_last_name", ""); web_ui()->CallJavascriptFunction(kJsApiSetUserInfo, value); -#endif } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index 599a771c79c..ff511a7ac95 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc @@ -30,9 +30,9 @@ #include "ui/base/resource/resource_bundle.h" #if defined(OS_CHROMEOS) +#include "base/chromeos/chromeos_version.h" #include "chrome/browser/chromeos/cros_settings.h" #include "chrome/browser/chromeos/login/user_manager.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #endif using content::WebContents; @@ -69,7 +69,7 @@ ChromeWebUIDataSource* CreateFlagsUIHTMLSource() { int idr = IDR_FLAGS_HTML; #if defined (OS_CHROMEOS) if (!chromeos::UserManager::Get()->IsCurrentUserOwner() && - chromeos::system::runtime_environment::IsRunningOnChromeOS()) + base::chromeos::IsRunningOnChromeOS()) idr = IDR_FLAGS_HTML_WARNING; #endif source->set_default_resource(idr); diff --git a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc index 57d5dfd25b6..7d0cca3d53d 100644 --- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc @@ -10,7 +10,6 @@ #include "base/values.h" #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/ui/webui/options/chromeos/system_settings_provider.h" #include "content/public/browser/web_ui.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc b/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc index a778a91205c..feec84b8c12 100644 --- a/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc +++ b/chrome/browser/ui/webui/options2/chromeos/bluetooth_options_handler2.cc @@ -10,7 +10,6 @@ #include "base/values.h" #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" -#include "chrome/browser/chromeos/system/runtime_environment.h" #include "chrome/browser/ui/webui/options2/chromeos/system_settings_provider2.h" #include "content/public/browser/web_ui.h" #include "grit/chromium_strings.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 0aba6daac0b..0e9282ab10b 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -869,8 +869,6 @@ 'browser/chromeos/system/input_device_settings.h', 'browser/chromeos/system/name_value_pairs_parser.cc', 'browser/chromeos/system/name_value_pairs_parser.h', - 'browser/chromeos/system/runtime_environment.cc', - 'browser/chromeos/system/runtime_environment.h', 'browser/chromeos/system/screen_locker_settings.cc', 'browser/chromeos/system/screen_locker_settings.h', 'browser/chromeos/system/statistics_provider.cc',