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 <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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 base::UTF8ToUTF16(kLearnMoreURL)); | 309 base::UTF8ToUTF16(kLearnMoreURL)); |
310 source->AddBoolean("keyboardOverlayHasChromeOSDiamondKey", | 310 source->AddBoolean("keyboardOverlayHasChromeOSDiamondKey", |
311 base::CommandLine::ForCurrentProcess()->HasSwitch( | 311 base::CommandLine::ForCurrentProcess()->HasSwitch( |
312 chromeos::switches::kHasChromeOSDiamondKey)); | 312 chromeos::switches::kHasChromeOSDiamondKey)); |
313 source->AddBoolean("keyboardOverlayTopRowKeysAreFunctionKeys", | 313 source->AddBoolean("keyboardOverlayTopRowKeysAreFunctionKeys", |
314 TopRowKeysAreFunctionKeys(profile)); | 314 TopRowKeysAreFunctionKeys(profile)); |
315 ash::Shell* shell = ash::Shell::Get(); | 315 ash::Shell* shell = ash::Shell::Get(); |
316 display::DisplayManager* display_manager = shell->display_manager(); | 316 display::DisplayManager* display_manager = shell->display_manager(); |
317 source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled", | 317 source->AddBoolean("keyboardOverlayIsDisplayUIScalingEnabled", |
318 display_manager->IsDisplayUIScalingEnabled()); | 318 display_manager->IsDisplayUIScalingEnabled()); |
319 source->AddBoolean( | |
320 "backspaceGoesBackFeatureEnabled", | |
321 base::FeatureList::IsEnabled(features::kBackspaceGoesBackFeature)); | |
michaelpg
2017/05/10 23:41:51
Looks like you can remove some #include's, as ther
ojan
2017/05/11 00:53:28
Pretty sure you caught the two files left that I m
| |
322 source->SetJsonPath("strings.js"); | 319 source->SetJsonPath("strings.js"); |
323 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); | 320 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); |
324 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML); | 321 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML); |
325 return source; | 322 return source; |
326 } | 323 } |
327 | 324 |
328 } // namespace | 325 } // namespace |
329 | 326 |
330 // The handler for Javascript messages related to the "keyboardoverlay" view. | 327 // The handler for Javascript messages related to the "keyboardoverlay" view. |
331 class KeyboardOverlayHandler | 328 class KeyboardOverlayHandler |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 424 |
428 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 425 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
429 : WebDialogUI(web_ui) { | 426 : WebDialogUI(web_ui) { |
430 Profile* profile = Profile::FromWebUI(web_ui); | 427 Profile* profile = Profile::FromWebUI(web_ui); |
431 web_ui->AddMessageHandler(base::MakeUnique<KeyboardOverlayHandler>(profile)); | 428 web_ui->AddMessageHandler(base::MakeUnique<KeyboardOverlayHandler>(profile)); |
432 | 429 |
433 // Set up the chrome://keyboardoverlay/ source. | 430 // Set up the chrome://keyboardoverlay/ source. |
434 content::WebUIDataSource::Add(profile, | 431 content::WebUIDataSource::Add(profile, |
435 CreateKeyboardOverlayUIHTMLSource(profile)); | 432 CreateKeyboardOverlayUIHTMLSource(profile)); |
436 } | 433 } |
OLD | NEW |