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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 content::WebUIDataSource::Create(chrome::kChromeUIKeyboardOverlayHost); 251 content::WebUIDataSource::Create(chrome::kChromeUIKeyboardOverlayHost);
252 252
253 for (size_t i = 0; i < arraysize(kI18nContentToMessage); ++i) { 253 for (size_t i = 0; i < arraysize(kI18nContentToMessage); ++i) {
254 source->AddLocalizedString(kI18nContentToMessage[i].i18n_content, 254 source->AddLocalizedString(kI18nContentToMessage[i].i18n_content,
255 kI18nContentToMessage[i].message); 255 kI18nContentToMessage[i].message);
256 } 256 }
257 257
258 source->AddString("keyboardOverlayLearnMoreURL", 258 source->AddString("keyboardOverlayLearnMoreURL",
259 base::UTF8ToUTF16(kLearnMoreURL)); 259 base::UTF8ToUTF16(kLearnMoreURL));
260 source->AddBoolean("keyboardOverlayHasChromeOSDiamondKey", 260 source->AddBoolean("keyboardOverlayHasChromeOSDiamondKey",
261 CommandLine::ForCurrentProcess()->HasSwitch( 261 base::CommandLine::ForCurrentProcess()->HasSwitch(
262 chromeos::switches::kHasChromeOSDiamondKey)); 262 chromeos::switches::kHasChromeOSDiamondKey));
263 ash::Shell* shell = ash::Shell::GetInstance(); 263 ash::Shell* shell = ash::Shell::GetInstance();
264 ash::DisplayManager* display_manager = shell->display_manager(); 264 ash::DisplayManager* display_manager = shell->display_manager();
265 source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled", 265 source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled",
266 display_manager->IsDisplayUIScalingEnabled()); 266 display_manager->IsDisplayUIScalingEnabled());
267 source->SetJsonPath("strings.js"); 267 source->SetJsonPath("strings.js");
268 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); 268 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS);
269 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML); 269 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML);
270 return source; 270 return source;
271 } 271 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) 375 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui)
376 : WebDialogUI(web_ui) { 376 : WebDialogUI(web_ui) {
377 Profile* profile = Profile::FromWebUI(web_ui); 377 Profile* profile = Profile::FromWebUI(web_ui);
378 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); 378 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile);
379 web_ui->AddMessageHandler(handler); 379 web_ui->AddMessageHandler(handler);
380 380
381 // Set up the chrome://keyboardoverlay/ source. 381 // Set up the chrome://keyboardoverlay/ source.
382 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource()); 382 content::WebUIDataSource::Add(profile, CreateKeyboardOverlayUIHTMLSource());
383 } 383 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698