| 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 "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 base::Unretained(this))); | 322 base::Unretained(this))); |
| 323 web_ui()->RegisterMessageCallback("openLearnMorePage", | 323 web_ui()->RegisterMessageCallback("openLearnMorePage", |
| 324 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage, | 324 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage, |
| 325 base::Unretained(this))); | 325 base::Unretained(this))); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) { | 328 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) { |
| 329 chromeos::input_method::InputMethodManager* manager = | 329 chromeos::input_method::InputMethodManager* manager = |
| 330 chromeos::input_method::InputMethodManager::Get(); | 330 chromeos::input_method::InputMethodManager::Get(); |
| 331 const chromeos::input_method::InputMethodDescriptor& descriptor = | 331 const chromeos::input_method::InputMethodDescriptor& descriptor = |
| 332 manager->GetCurrentInputMethod(); | 332 manager->GetActiveIMEState()->GetCurrentInputMethod(); |
| 333 base::StringValue param(descriptor.id()); | 333 base::StringValue param(descriptor.id()); |
| 334 web_ui()->CallJavascriptFunction("initKeyboardOverlayId", param); | 334 web_ui()->CallJavascriptFunction("initKeyboardOverlayId", param); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) { | 337 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) { |
| 338 DCHECK(profile_); | 338 DCHECK(profile_); |
| 339 PrefService* pref_service = profile_->GetPrefs(); | 339 PrefService* pref_service = profile_->GetPrefs(); |
| 340 typedef std::map<ModifierKey, ModifierKey> ModifierMap; | 340 typedef std::map<ModifierKey, ModifierKey> ModifierMap; |
| 341 ModifierMap modifier_map; | 341 ModifierMap modifier_map; |
| 342 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( | 342 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 376 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
| 377 : WebDialogUI(web_ui) { | 377 : WebDialogUI(web_ui) { |
| 378 Profile* profile = Profile::FromWebUI(web_ui); | 378 Profile* profile = Profile::FromWebUI(web_ui); |
| 379 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); | 379 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); |
| 380 web_ui->AddMessageHandler(handler); | 380 web_ui->AddMessageHandler(handler); |
| 381 | 381 |
| 382 // Set up the chrome://keyboardoverlay/ source. | 382 // Set up the chrome://keyboardoverlay/ source. |
| 383 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); | 383 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); |
| 384 } | 384 } |
| OLD | NEW |