OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chromeos/dom_ui/keyboard_overlay_ui.h" | 5 #include "chrome/browser/chromeos/dom_ui/keyboard_overlay_ui.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "base/weak_ptr.h" | 9 #include "base/weak_ptr.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
11 #include "chrome/browser/chromeos/cros/cros_library.h" | 11 #include "chrome/browser/chromeos/cros/cros_library.h" |
12 #include "chrome/browser/chromeos/cros/input_method_library.h" | 12 #include "chrome/browser/chromeos/cros/input_method_library.h" |
13 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 13 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 14 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/tab_contents/tab_contents.h" |
15 #include "chrome/common/jstemplate_builder.h" | 17 #include "chrome/common/jstemplate_builder.h" |
16 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
17 #include "grit/browser_resources.h" | 19 #include "grit/browser_resources.h" |
18 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
19 #include "third_party/cros/chromeos_input_method.h" | 21 #include "third_party/cros/chromeos_input_method.h" |
20 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
22 | 24 |
23 | 25 |
24 class KeyboardOverlayUIHTMLSource : public ChromeURLDataManager::DataSource { | 26 class KeyboardOverlayUIHTMLSource : public ChromeURLDataManager::DataSource { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // | 289 // |
288 //////////////////////////////////////////////////////////////////////////////// | 290 //////////////////////////////////////////////////////////////////////////////// |
289 | 291 |
290 KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents) | 292 KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents) |
291 : HtmlDialogUI(contents) { | 293 : HtmlDialogUI(contents) { |
292 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(); | 294 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(); |
293 AddMessageHandler((handler)->Attach(this)); | 295 AddMessageHandler((handler)->Attach(this)); |
294 KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource(); | 296 KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource(); |
295 | 297 |
296 // Set up the chrome://keyboardoverlay/ source. | 298 // Set up the chrome://keyboardoverlay/ source. |
297 BrowserThread::PostTask( | 299 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
298 BrowserThread::IO, FROM_HERE, | |
299 NewRunnableMethod( | |
300 ChromeURLDataManager::GetInstance(), | |
301 &ChromeURLDataManager::AddDataSource, | |
302 make_scoped_refptr(html_source))); | |
303 } | 300 } |
OLD | NEW |