| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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::internal::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->SetUseJsonJSFormatV2(); | 268 source->SetUseJsonJSFormatV2(); |
| 269 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); | 269 source->AddResourcePath("keyboard_overlay.js", IDR_KEYBOARD_OVERLAY_JS); |
| 270 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML); | 270 source->SetDefaultResource(IDR_KEYBOARD_OVERLAY_HTML); |
| 271 return source; | 271 return source; |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace | 274 } // namespace |
| (...skipping 100 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 |