| 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" | |
| 17 #include "chrome/common/jstemplate_builder.h" | 15 #include "chrome/common/jstemplate_builder.h" |
| 18 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 19 #include "grit/browser_resources.h" | 17 #include "grit/browser_resources.h" |
| 20 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 21 #include "third_party/cros/chromeos_input_method.h" | 19 #include "third_party/cros/chromeos_input_method.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 24 | 22 |
| 25 | 23 |
| 26 class KeyboardOverlayUIHTMLSource : public ChromeURLDataManager::DataSource { | 24 class KeyboardOverlayUIHTMLSource : public ChromeURLDataManager::DataSource { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // | 287 // |
| 290 //////////////////////////////////////////////////////////////////////////////// | 288 //////////////////////////////////////////////////////////////////////////////// |
| 291 | 289 |
| 292 KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents) | 290 KeyboardOverlayUI::KeyboardOverlayUI(TabContents* contents) |
| 293 : HtmlDialogUI(contents) { | 291 : HtmlDialogUI(contents) { |
| 294 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(); | 292 KeyboardOverlayHandler* handler = new KeyboardOverlayHandler(); |
| 295 AddMessageHandler((handler)->Attach(this)); | 293 AddMessageHandler((handler)->Attach(this)); |
| 296 KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource(); | 294 KeyboardOverlayUIHTMLSource* html_source = new KeyboardOverlayUIHTMLSource(); |
| 297 | 295 |
| 298 // Set up the chrome://keyboardoverlay/ source. | 296 // Set up the chrome://keyboardoverlay/ source. |
| 299 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 297 BrowserThread::PostTask( |
| 298 BrowserThread::IO, FROM_HERE, |
| 299 NewRunnableMethod( |
| 300 ChromeURLDataManager::GetInstance(), |
| 301 &ChromeURLDataManager::AddDataSource, |
| 302 make_scoped_refptr(html_source))); |
| 300 } | 303 } |
| OLD | NEW |