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

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

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 6 years, 4 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
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 "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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 base::Unretained(this))); 324 base::Unretained(this)));
325 web_ui()->RegisterMessageCallback("openLearnMorePage", 325 web_ui()->RegisterMessageCallback("openLearnMorePage",
326 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage, 326 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage,
327 base::Unretained(this))); 327 base::Unretained(this)));
328 } 328 }
329 329
330 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) { 330 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) {
331 chromeos::input_method::InputMethodManager* manager = 331 chromeos::input_method::InputMethodManager* manager =
332 chromeos::input_method::InputMethodManager::Get(); 332 chromeos::input_method::InputMethodManager::Get();
333 const chromeos::input_method::InputMethodDescriptor& descriptor = 333 const chromeos::input_method::InputMethodDescriptor& descriptor =
334 manager->GetCurrentInputMethod(); 334 manager->GetActiveIMEState()->GetCurrentInputMethod();
335 base::StringValue param(descriptor.id()); 335 base::StringValue param(descriptor.id());
336 web_ui()->CallJavascriptFunction("initKeyboardOverlayId", param); 336 web_ui()->CallJavascriptFunction("initKeyboardOverlayId", param);
337 } 337 }
338 338
339 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) { 339 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) {
340 DCHECK(profile_); 340 DCHECK(profile_);
341 PrefService* pref_service = profile_->GetPrefs(); 341 PrefService* pref_service = profile_->GetPrefs();
342 typedef std::map<ModifierKey, ModifierKey> ModifierMap; 342 typedef std::map<ModifierKey, ModifierKey> ModifierMap;
343 ModifierMap modifier_map; 343 ModifierMap modifier_map;
344 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( 344 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) 378 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui)
379 : WebDialogUI(web_ui) { 379 : WebDialogUI(web_ui) {
380 Profile* profile = Profile::FromWebUI(web_ui); 380 Profile* profile = Profile::FromWebUI(web_ui);
381 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); 381 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile);
382 web_ui->AddMessageHandler(handler); 382 web_ui->AddMessageHandler(handler);
383 383
384 // Set up the chrome://keyboardoverlay/ source. 384 // Set up the chrome://keyboardoverlay/ source.
385 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); 385 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource());
386 } 386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698