Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(657)

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 139803010: Support comma separated hardware keyboard layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/preferences.h" 5 #include "chrome/browser/chromeos/preferences.h"
6 6
7 #include <vector>
8
7 #include "ash/autoclick/autoclick_controller.h" 9 #include "ash/autoclick/autoclick_controller.h"
8 #include "ash/magnifier/magnifier_constants.h" 10 #include "ash/magnifier/magnifier_constants.h"
9 #include "ash/shell.h" 11 #include "ash/shell.h"
10 #include "base/command_line.h" 12 #include "base/command_line.h"
11 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
12 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
13 #include "base/prefs/pref_member.h" 15 #include "base/prefs/pref_member.h"
14 #include "base/prefs/pref_registry_simple.h" 16 #include "base/prefs/pref_registry_simple.h"
15 #include "base/prefs/scoped_user_pref_update.h" 17 #include "base/prefs/scoped_user_pref_update.h"
16 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 87
86 // static 88 // static
87 void Preferences::RegisterProfilePrefs( 89 void Preferences::RegisterProfilePrefs(
88 user_prefs::PrefRegistrySyncable* registry) { 90 user_prefs::PrefRegistrySyncable* registry) {
89 std::string hardware_keyboard_id; 91 std::string hardware_keyboard_id;
90 // TODO(yusukes): Remove the runtime hack. 92 // TODO(yusukes): Remove the runtime hack.
91 if (base::SysInfo::IsRunningOnChromeOS()) { 93 if (base::SysInfo::IsRunningOnChromeOS()) {
92 input_method::InputMethodManager* manager = 94 input_method::InputMethodManager* manager =
93 input_method::InputMethodManager::Get(); 95 input_method::InputMethodManager::Get();
94 if (manager) { 96 if (manager) {
95 hardware_keyboard_id = 97 const std::vector<std::string>& hardware_layouts =
96 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); 98 manager->GetInputMethodUtil()->GetHardwareInputMethodIds();
99 hardware_keyboard_id = JoinString(hardware_layouts, ',');
97 } 100 }
98 } else { 101 } else {
99 hardware_keyboard_id = "xkb:us::eng"; // only for testing. 102 hardware_keyboard_id = "xkb:us::eng"; // only for testing.
100 } 103 }
101 104
102 registry->RegisterBooleanPref( 105 registry->RegisterBooleanPref(
103 prefs::kPerformanceTracingEnabled, 106 prefs::kPerformanceTracingEnabled,
104 false, 107 false,
105 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 108 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
106 109
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 632 }
630 633
631 void Preferences::OnTouchHudProjectionToggled(bool enabled) { 634 void Preferences::OnTouchHudProjectionToggled(bool enabled) {
632 if (touch_hud_projection_enabled_.GetValue() == enabled) 635 if (touch_hud_projection_enabled_.GetValue() == enabled)
633 return; 636 return;
634 637
635 touch_hud_projection_enabled_.SetValue(enabled); 638 touch_hud_projection_enabled_.SetValue(enabled);
636 } 639 }
637 640
638 } // namespace chromeos 641 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698