Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |