| 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/ash_keyboard_controller_proxy.h" | 5 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 11 #include "content/public/browser/host_zoom_map.h" | 11 #include "content/public/browser/host_zoom_map.h" |
| 12 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
| 13 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
| 14 #include "content/public/browser/site_instance.h" | 14 #include "content/public/browser/site_instance.h" |
| 15 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "extensions/browser/event_router.h" | 16 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/browser/view_type_utils.h" | 18 #include "extensions/browser/view_type_utils.h" |
| 19 #include "extensions/common/api/virtual_keyboard_private.h" | 19 #include "extensions/common/api/virtual_keyboard_private.h" |
| 20 #include "extensions/common/constants.h" | 20 #include "extensions/common/constants.h" |
| 21 #include "extensions/common/extension_messages.h" | 21 #include "extensions/common/extension_messages.h" |
| 22 #include "ipc/ipc_message_macros.h" | 22 #include "ipc/ipc_message_macros.h" |
| 23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_event_dispatcher.h" | 24 #include "ui/aura/window_event_dispatcher.h" |
| 25 #include "ui/aura/window_tree_host.h" | 25 #include "ui/aura/window_tree_host.h" |
| 26 #include "ui/compositor/scoped_layer_animation_settings.h" | 26 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 27 #include "ui/keyboard/keyboard_controller.h" | 27 #include "ui/keyboard/keyboard_controller.h" |
| 28 #include "ui/keyboard/keyboard_controller_observer.h" | 28 #include "ui/keyboard/keyboard_controller_observer.h" |
| 29 | 29 |
| 30 namespace virtual_keyboard_private = | 30 namespace virtual_keyboard_private = extensions::api::virtual_keyboard_private; |
| 31 extensions::core_api::virtual_keyboard_private; | |
| 32 | 31 |
| 33 typedef virtual_keyboard_private::OnTextInputBoxFocused::Context Context; | 32 typedef virtual_keyboard_private::OnTextInputBoxFocused::Context Context; |
| 34 | 33 |
| 35 namespace { | 34 namespace { |
| 36 | 35 |
| 37 const char* kVirtualKeyboardExtensionID = "mppnpdlheglhdfmldimlhpnegondlapf"; | 36 const char* kVirtualKeyboardExtensionID = "mppnpdlheglhdfmldimlhpnegondlapf"; |
| 38 | 37 |
| 39 virtual_keyboard_private::OnTextInputBoxFocusedType | 38 virtual_keyboard_private::OnTextInputBoxFocusedType |
| 40 TextInputTypeToGeneratedInputTypeEnum(ui::TextInputType type) { | 39 TextInputTypeToGeneratedInputTypeEnum(ui::TextInputType type) { |
| 41 switch (type) { | 40 switch (type) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 TextInputTypeToGeneratedInputTypeEnum(type))); | 200 TextInputTypeToGeneratedInputTypeEnum(type))); |
| 202 event_args->Append(input_context.release()); | 201 event_args->Append(input_context.release()); |
| 203 | 202 |
| 204 scoped_ptr<extensions::Event> event(new extensions::Event( | 203 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 205 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, | 204 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, |
| 206 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 205 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
| 207 event_args.Pass())); | 206 event_args.Pass())); |
| 208 event->restrict_to_browser_context = browser_context(); | 207 event->restrict_to_browser_context = browser_context(); |
| 209 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); | 208 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); |
| 210 } | 209 } |
| OLD | NEW |