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

Side by Side Diff: chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc

Issue 11314020: Allow Caps Lock to be remapped [part 1 of 2] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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/ui/webui/chromeos/keyboard_overlay_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 DCHECK(profile_); 306 DCHECK(profile_);
307 PrefService* pref_service = profile_->GetPrefs(); 307 PrefService* pref_service = profile_->GetPrefs();
308 typedef std::map<ModifierKey, ModifierKey> ModifierMap; 308 typedef std::map<ModifierKey, ModifierKey> ModifierMap;
309 ModifierMap modifier_map; 309 ModifierMap modifier_map;
310 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( 310 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>(
311 pref_service->GetInteger(prefs::kLanguageRemapSearchKeyTo)); 311 pref_service->GetInteger(prefs::kLanguageRemapSearchKeyTo));
312 modifier_map[chromeos::input_method::kControlKey] = static_cast<ModifierKey>( 312 modifier_map[chromeos::input_method::kControlKey] = static_cast<ModifierKey>(
313 pref_service->GetInteger(prefs::kLanguageRemapControlKeyTo)); 313 pref_service->GetInteger(prefs::kLanguageRemapControlKeyTo));
314 modifier_map[chromeos::input_method::kAltKey] = static_cast<ModifierKey>( 314 modifier_map[chromeos::input_method::kAltKey] = static_cast<ModifierKey>(
315 pref_service->GetInteger(prefs::kLanguageRemapAltKeyTo)); 315 pref_service->GetInteger(prefs::kLanguageRemapAltKeyTo));
316 // TODO(mazda): Support prefs::kLanguageRemapCapsLockKeyTo once Caps Lock is
mazda 2012/10/30 18:26:03 Could you file a bug for this?
Yusuke Sato 2012/10/30 19:11:33 Done: http://code.google.com/p/chromium/issues/det
317 // added to the overlay UI.
316 318
317 DictionaryValue dict; 319 DictionaryValue dict;
318 for (ModifierMap::const_iterator i = modifier_map.begin(); 320 for (ModifierMap::const_iterator i = modifier_map.begin();
319 i != modifier_map.end(); ++i) { 321 i != modifier_map.end(); ++i) {
320 dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second)); 322 dict.SetString(ModifierKeyToLabel(i->first), ModifierKeyToLabel(i->second));
321 } 323 }
322 324
323 web_ui()->CallJavascriptFunction("initIdentifierMap", dict); 325 web_ui()->CallJavascriptFunction("initIdentifierMap", dict);
324 } 326 }
325 327
(...skipping 16 matching lines...) Expand all
342 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) 344 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui)
343 : WebDialogUI(web_ui) { 345 : WebDialogUI(web_ui) {
344 Profile* profile = Profile::FromWebUI(web_ui); 346 Profile* profile = Profile::FromWebUI(web_ui);
345 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); 347 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile);
346 web_ui->AddMessageHandler(handler); 348 web_ui->AddMessageHandler(handler);
347 349
348 // Set up the chrome://keyboardoverlay/ source. 350 // Set up the chrome://keyboardoverlay/ source.
349 ChromeURLDataManager::AddDataSource(profile, 351 ChromeURLDataManager::AddDataSource(profile,
350 CreateKeyboardOverlayUIHTMLSource()); 352 CreateKeyboardOverlayUIHTMLSource());
351 } 353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698