| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ash/chrome_keyboard_ui.h" | 5 #include "chrome/browser/ui/ash/chrome_keyboard_ui.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 extensions::ExtensionRegistry::Get(browser_context()); | 136 extensions::ExtensionRegistry::Get(browser_context()); |
| 137 extension = registry->enabled_extensions().GetByID(origin.host()); | 137 extension = registry->enabled_extensions().GetByID(origin.host()); |
| 138 DCHECK(extension); | 138 DCHECK(extension); |
| 139 } | 139 } |
| 140 | 140 |
| 141 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( | 141 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( |
| 142 web_contents, request, callback, extension); | 142 web_contents, request, callback, extension); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ChromeKeyboardUI::SetupWebContents(content::WebContents* contents) { | 145 void ChromeKeyboardUI::SetupWebContents(content::WebContents* contents) { |
| 146 extensions::SetViewType(contents, extensions::VIEW_TYPE_VIRTUAL_KEYBOARD); | 146 extensions::SetViewType(contents, extensions::VIEW_TYPE_COMPONENT); |
| 147 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 147 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 148 contents); | 148 contents); |
| 149 Observe(contents); | 149 Observe(contents); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ChromeKeyboardUI::SetController(keyboard::KeyboardController* controller) { | 152 void ChromeKeyboardUI::SetController(keyboard::KeyboardController* controller) { |
| 153 // During KeyboardController destruction, controller can be set to null. | 153 // During KeyboardController destruction, controller can be set to null. |
| 154 if (!controller) { | 154 if (!controller) { |
| 155 DCHECK(keyboard_controller()); | 155 DCHECK(keyboard_controller()); |
| 156 keyboard_controller()->RemoveObserver(observer_.get()); | 156 keyboard_controller()->RemoveObserver(observer_.get()); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 event_args->Append(input_context.release()); | 218 event_args->Append(input_context.release()); |
| 219 | 219 |
| 220 scoped_ptr<extensions::Event> event(new extensions::Event( | 220 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 221 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, | 221 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, |
| 222 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 222 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
| 223 std::move(event_args))); | 223 std::move(event_args))); |
| 224 event->restrict_to_browser_context = browser_context(); | 224 event->restrict_to_browser_context = browser_context(); |
| 225 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, | 225 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, |
| 226 std::move(event)); | 226 std::move(event)); |
| 227 } | 227 } |
| OLD | NEW |