summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-27 00:50:10 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-27 00:50:10 +0000
commitc94ac691e0f7331276aa1126bb2058c0c8ead085 (patch)
treeb8eb26a266703c43535ec4be423d2b58dc39064e
parentd6c10b08d88c0cbaad4670d90eca0bd940856316 (diff)
downloadchromium_src-c94ac691e0f7331276aa1126bb2058c0c8ead085.zip
chromium_src-c94ac691e0f7331276aa1126bb2058c0c8ead085.tar.gz
chromium_src-c94ac691e0f7331276aa1126bb2058c0c8ead085.tar.bz2
Set default OEM customization values for remora.
BUG=263059 TEST=manual Review URL: https://chromiumcodereview.appspot.com/19970003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214012 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_content_browser_client.cc11
-rw-r--r--chrome/browser/chromeos/keyboard_driven_event_rewriter.cc11
-rw-r--r--chrome/browser/chromeos/login/login_display_host_impl.cc8
-rw-r--r--chrome/browser/chromeos/system/input_device_settings.cc34
-rw-r--r--chrome/browser/chromeos/system/input_device_settings.h8
-rw-r--r--chrome/browser/chromeos/system/statistics_provider.cc2
-rw-r--r--chrome/browser/extensions/scoped_gaia_auth_extension.cc8
-rw-r--r--chrome/browser/ui/views/chrome_views_delegate_chromeos.cc9
-rw-r--r--chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc12
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc7
-rw-r--r--chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc7
-rw-r--r--chrome/browser/ui/webui/options/chromeos/proxy_handler.cc7
12 files changed, 70 insertions, 54 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index e21cc146..92e1f62 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -153,7 +153,7 @@
#include "chrome/browser/chromeos/fileapi/file_system_backend.h"
#include "chrome/browser/chromeos/login/startup_utils.h"
#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chromeos/chromeos_switches.h"
#elif defined(OS_LINUX)
#include "chrome/browser/chrome_browser_main_linux.h"
@@ -2088,12 +2088,9 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
// Enable password echo during OOBE when keyboard driven flag is set.
if (chromeos::UserManager::IsInitialized() &&
!chromeos::UserManager::Get()->IsUserLoggedIn() &&
- !chromeos::StartupUtils::IsOobeCompleted()) {
- bool keyboard_driven_oobe = false;
- chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
- if (keyboard_driven_oobe)
- web_prefs->password_echo_enabled = true;
+ !chromeos::StartupUtils::IsOobeCompleted() &&
+ chromeos::system::keyboard_settings::ForceKeyboardDrivenUINavigation()) {
+ web_prefs->password_echo_enabled = true;
}
#endif
diff --git a/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc b/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
index 7e254ab..121116c 100644
--- a/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
+++ b/chrome/browser/chromeos/keyboard_driven_event_rewriter.cc
@@ -7,7 +7,7 @@
#include <X11/Xlib.h>
#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "ui/base/events/event.h"
namespace chromeos {
@@ -19,12 +19,9 @@ const int kModifierMask = ui::EF_SHIFT_DOWN;
// Returns true if and only if it is on login screen (i.e. user is not logged
// in) and the keyboard driven flag in the OEM manifest is on.
bool ShouldStripModifiersForArrowKeysAndEnter() {
- if (chromeos::UserManager::IsInitialized() &&
- !chromeos::UserManager::Get()->IsUserLoggedIn()) {
- bool keyboard_driven_oobe = false;
- chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
- return keyboard_driven_oobe;
+ if (UserManager::IsInitialized() &&
+ !UserManager::Get()->IsUserLoggedIn()) {
+ return system::keyboard_settings::ForceKeyboardDrivenUINavigation();
}
return false;
diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc
index dea6f11..4148d9c 100644
--- a/chrome/browser/chromeos/login/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/login_display_host_impl.cc
@@ -40,7 +40,7 @@
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/mobile_config.h"
#include "chrome/browser/chromeos/policy/auto_enrollment_client.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/chromeos/system/timezone_settings.h"
#include "chrome/browser/chromeos/ui/focus_ring_controller.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -257,11 +257,7 @@ LoginDisplayHostImpl::LoginDisplayHostImpl(const gfx::Rect& background_bounds)
<< " wait_for_pods_: " << waiting_for_user_pods_
<< " init_webui_hidden_: " << initialize_webui_hidden_;
- bool keyboard_driven_oobe = false;
- system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey,
- &keyboard_driven_oobe);
- if (keyboard_driven_oobe) {
+ if (system::keyboard_settings::ForceKeyboardDrivenUINavigation()) {
views::FocusManager::set_arrow_key_traversal_enabled(true);
focus_ring_controller_.reset(new FocusRingController);
diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc
index 48d3629..dd576fb 100644
--- a/chrome/browser/chromeos/system/input_device_settings.cc
+++ b/chrome/browser/chromeos/system/input_device_settings.cc
@@ -21,6 +21,11 @@
#include "base/strings/stringprintf.h"
#include "base/task_runner.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
+#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/policy/browser_policy_connector.h"
+#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
namespace chromeos {
@@ -31,6 +36,8 @@ namespace {
const char kTpControl[] = "/opt/google/touchpad/tpcontrol";
const char kMouseControl[] = "/opt/google/mouse/mousecontrol";
+const char kRemoraRequisition[] = "remora";
+
typedef base::RefCountedData<bool> RefCountedBool;
bool ScriptExists(const std::string& script) {
@@ -180,5 +187,32 @@ void SetPrimaryButtonRight(bool right) {
} // namespace mouse_settings
+namespace keyboard_settings {
+
+bool ForceKeyboardDrivenUINavigation() {
+ policy::BrowserPolicyConnector* connector =
+ g_browser_process->browser_policy_connector();
+ if (!connector)
+ return false;
+
+ policy::DeviceCloudPolicyManagerChromeOS* policy_manager =
+ connector->GetDeviceCloudPolicyManager();
+ if (!policy_manager)
+ return false;
+
+ if (policy_manager->GetDeviceRequisition() == kRemoraRequisition)
+ return true;
+
+ bool keyboard_driven = false;
+ if (chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag(
+ kOemKeyboardDrivenOobeKey, &keyboard_driven)) {
+ return keyboard_driven;
+ }
+
+ return false;
+}
+
+} // namespace keyboard_settings
+
} // namespace system
} // namespace chromeos
diff --git a/chrome/browser/chromeos/system/input_device_settings.h b/chrome/browser/chromeos/system/input_device_settings.h
index ac3c65a..d5a5a49 100644
--- a/chrome/browser/chromeos/system/input_device_settings.h
+++ b/chrome/browser/chromeos/system/input_device_settings.h
@@ -49,6 +49,14 @@ void SetPrimaryButtonRight(bool right);
} // namespace mouse_settings
+namespace keyboard_settings {
+
+// Returns true if UI should implement enhanced keyboard support for cases where
+// other input devices like mouse are absent.
+bool ForceKeyboardDrivenUINavigation();
+
+} // namespace keyboard_settings
+
} // namespace system
} // namespace chromeos
diff --git a/chrome/browser/chromeos/system/statistics_provider.cc b/chrome/browser/chromeos/system/statistics_provider.cc
index e58278b..8680f94 100644
--- a/chrome/browser/chromeos/system/statistics_provider.cc
+++ b/chrome/browser/chromeos/system/statistics_provider.cc
@@ -138,8 +138,6 @@ void StatisticsProviderImpl::Init() {
// Load the machine info file immediately to get the channel info.
LoadMachineOSInfoFile();
- // Load the machine info file immediately to get the channel info.
- LoadOemManifest();
}
bool StatisticsProviderImpl::GetMachineStatistic(
diff --git a/chrome/browser/extensions/scoped_gaia_auth_extension.cc b/chrome/browser/extensions/scoped_gaia_auth_extension.cc
index 57e160e..310c7da 100644
--- a/chrome/browser/extensions/scoped_gaia_auth_extension.cc
+++ b/chrome/browser/extensions/scoped_gaia_auth_extension.cc
@@ -14,7 +14,7 @@
#include "grit/browser_resources.h"
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chromeos/chromeos_constants.h"
#include "chromeos/chromeos_switches.h"
#endif
@@ -40,10 +40,8 @@ void LoadGaiaAuthExtension(Profile* profile) {
bool force_keyboard_oobe = false;
#if defined(OS_CHROMEOS)
- chromeos::system::StatisticsProvider* provider =
- chromeos::system::StatisticsProvider::GetInstance();
- provider->GetMachineFlag(chromeos::system::kOemKeyboardDrivenOobeKey,
- &force_keyboard_oobe);
+ force_keyboard_oobe =
+ chromeos::system::keyboard_settings::ForceKeyboardDrivenUINavigation();
#endif // OS_CHROMEOS
if (force_keyboard_oobe) {
component_loader->Add(IDR_GAIA_AUTH_KEYBOARD_MANIFEST,
diff --git a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
index e1bcf4a..4a63f2c 100644
--- a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
@@ -6,18 +6,15 @@
#include "base/time/time.h"
#include "chrome/browser/chromeos/login/user_manager.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chromeos/chromeos_constants.h"
base::TimeDelta
ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() {
// Enable password echo on login screen when the keyboard driven flag is set.
if (chromeos::UserManager::IsInitialized() &&
- !chromeos::UserManager::Get()->IsUserLoggedIn()) {
- bool keyboard_driven_oobe = false;
- chromeos::system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
- if (keyboard_driven_oobe)
+ !chromeos::UserManager::Get()->IsUserLoggedIn() &&
+ chromeos::system::keyboard_settings::ForceKeyboardDrivenUINavigation()) {
return base::TimeDelta::FromSeconds(1);
}
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
index f41bbc8..5a6a1c9 100644
--- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/common/chrome_constants.h"
@@ -196,14 +196,8 @@ void CoreOobeHandler::UpdateOobeUIVisibility() {
}
CallJS("cr.ui.Oobe.showVersion", should_show_version);
CallJS("cr.ui.Oobe.showOobeUI", show_oobe_ui_);
-
- bool enable_keyboard_flow = false;
- chromeos::system::StatisticsProvider* provider =
- chromeos::system::StatisticsProvider::GetInstance();
- provider->GetMachineFlag(chromeos::system::kOemKeyboardDrivenOobeKey,
- &enable_keyboard_flow);
- if (enable_keyboard_flow)
- CallJS("cr.ui.Oobe.enableKeyboardFlow", enable_keyboard_flow);
+ if (system::keyboard_settings::ForceKeyboardDrivenUINavigation())
+ CallJS("cr.ui.Oobe.enableKeyboardFlow", true);
}
void CoreOobeHandler::OnOSVersionLabelTextUpdated(
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index ef64deb..120986e 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/chromeos/login/screen_locker.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/about_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
@@ -347,9 +347,8 @@ void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) {
localized_strings->SetString("bootIntoWallpaper", "off");
}
- bool keyboard_driven_oobe = false;
- system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
+ bool keyboard_driven_oobe =
+ system::keyboard_settings::ForceKeyboardDrivenUINavigation();
localized_strings->SetString("highlightStrength",
keyboard_driven_oobe ? "strong" : "normal");
}
diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
index c136db5..d26b02e 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -7,7 +7,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.h"
#include "chrome/browser/ui/webui/options/chromeos/proxy_handler.h"
@@ -99,9 +99,8 @@ ProxySettingsUI::ProxySettingsUI(content::WebUI* web_ui)
proxy_handler_->GetLocalizedValues(localized_strings);
web_ui->AddMessageHandler(proxy_handler_);
- bool keyboard_driven_oobe = false;
- system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
+ bool keyboard_driven_oobe =
+ system::keyboard_settings::ForceKeyboardDrivenUINavigation();
localized_strings->SetString("highlightStrength",
keyboard_driven_oobe ? "strong" : "normal");
diff --git a/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc b/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc
index 4ed2345..c5d6715 100644
--- a/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/proxy_handler.cc
@@ -10,7 +10,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
-#include "chrome/browser/chromeos/system/statistics_provider.h"
+#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/common/chrome_constants.h"
#include "chromeos/chromeos_constants.h"
#include "content/public/browser/web_ui.h"
@@ -68,9 +68,8 @@ void ProxyHandler::GetLocalizedValues(
void ProxyHandler::InitializePage() {
::options::OptionsPageUIHandler::InitializePage();
- bool keyboard_driven_oobe = false;
- system::StatisticsProvider::GetInstance()->GetMachineFlag(
- chromeos::system::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe);
+ bool keyboard_driven_oobe =
+ system::keyboard_settings::ForceKeyboardDrivenUINavigation();
if (keyboard_driven_oobe) {
web_ui()->CallJavascriptFunction(
"DetailsInternetPage.initializeKeyboardFlow");