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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 13 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
15 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 15 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 19 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/jstemplate_builder.h" | 21 #include "chrome/common/jstemplate_builder.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
24 #include "content/public/browser/browser_thread.h" | |
25 #include "content/public/browser/page_navigator.h" | 24 #include "content/public/browser/page_navigator.h" |
26 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
27 #include "content/public/browser/web_contents_delegate.h" | 26 #include "content/public/browser/web_contents_delegate.h" |
28 #include "content/public/browser/web_ui.h" | 27 #include "content/public/browser/web_ui.h" |
29 #include "content/public/browser/web_ui_message_handler.h" | 28 #include "content/public/browser/web_ui_message_handler.h" |
30 #include "grit/browser_resources.h" | 29 #include "grit/browser_resources.h" |
31 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
32 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) | 358 KeyboardOverlayUI::KeyboardOverlayUI(content::WebUI* web_ui) |
360 : WebDialogUI(web_ui) { | 359 : WebDialogUI(web_ui) { |
361 Profile* profile = Profile::FromWebUI(web_ui); | 360 Profile* profile = Profile::FromWebUI(web_ui); |
362 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); | 361 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(profile); |
363 web_ui->AddMessageHandler(handler); | 362 web_ui->AddMessageHandler(handler); |
364 | 363 |
365 // Set up the chrome://keyboardoverlay/ source. | 364 // Set up the chrome://keyboardoverlay/ source. |
366 ChromeURLDataManager::AddDataSource(profile, | 365 ChromeURLDataManager::AddDataSource(profile, |
367 CreateKeyboardOverlayUIHTMLSource()); | 366 CreateKeyboardOverlayUIHTMLSource()); |
368 } | 367 } |
OLD | NEW |