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

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

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 web_ui()->RegisterMessageCallback("openLearnMorePage", 373 web_ui()->RegisterMessageCallback("openLearnMorePage",
374 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage, 374 base::Bind(&KeyboardOverlayHandler::OpenLearnMorePage,
375 base::Unretained(this))); 375 base::Unretained(this)));
376 } 376 }
377 377
378 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) { 378 void KeyboardOverlayHandler::GetInputMethodId(const base::ListValue* args) {
379 chromeos::input_method::InputMethodManager* manager = 379 chromeos::input_method::InputMethodManager* manager =
380 chromeos::input_method::InputMethodManager::Get(); 380 chromeos::input_method::InputMethodManager::Get();
381 const chromeos::input_method::InputMethodDescriptor& descriptor = 381 const chromeos::input_method::InputMethodDescriptor& descriptor =
382 manager->GetActiveIMEState()->GetCurrentInputMethod(); 382 manager->GetActiveIMEState()->GetCurrentInputMethod();
383 base::StringValue param(descriptor.id()); 383 base::Value param(descriptor.id());
384 web_ui()->CallJavascriptFunctionUnsafe("initKeyboardOverlayId", param); 384 web_ui()->CallJavascriptFunctionUnsafe("initKeyboardOverlayId", param);
385 } 385 }
386 386
387 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) { 387 void KeyboardOverlayHandler::GetLabelMap(const base::ListValue* args) {
388 DCHECK(profile_); 388 DCHECK(profile_);
389 PrefService* pref_service = profile_->GetPrefs(); 389 PrefService* pref_service = profile_->GetPrefs();
390 typedef std::map<ModifierKey, ModifierKey> ModifierMap; 390 typedef std::map<ModifierKey, ModifierKey> ModifierMap;
391 ModifierMap modifier_map; 391 ModifierMap modifier_map;
392 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>( 392 modifier_map[chromeos::input_method::kSearchKey] = static_cast<ModifierKey>(
393 pref_service->GetInteger(prefs::kLanguageRemapSearchKeyTo)); 393 pref_service->GetInteger(prefs::kLanguageRemapSearchKeyTo));
(...skipping 29 matching lines...) Expand all
423 423
424 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) 424 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui)
425 : WebDialogUI(web_ui) { 425 : WebDialogUI(web_ui) {
426 Profile* profile = Profile::FromWebUI(web_ui); 426 Profile* profile = Profile::FromWebUI(web_ui);
427 web_ui->AddMessageHandler(base::MakeUnique<KeyboardOverlayHandler>(profile)); 427 web_ui->AddMessageHandler(base::MakeUnique<KeyboardOverlayHandler>(profile));
428 428
429 // Set up the chrome://keyboardoverlay/ source. 429 // Set up the chrome://keyboardoverlay/ source.
430 content::WebUIDataSource::Add(profile, 430 content::WebUIDataSource::Add(profile,
431 CreateKeyboardOverlayUIHTMLSource(profile)); 431 CreateKeyboardOverlayUIHTMLSource(profile));
432 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698