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> |
| 8 |
7 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 10 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 13 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
12 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 14 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
13 #include "content/public/browser/host_zoom_map.h" | 15 #include "content/public/browser/host_zoom_map.h" |
14 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
15 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
16 #include "content/public/browser/site_instance.h" | 18 #include "content/public/browser/site_instance.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 scoped_ptr<base::DictionaryValue> new_bounds(new base::DictionaryValue()); | 92 scoped_ptr<base::DictionaryValue> new_bounds(new base::DictionaryValue()); |
91 new_bounds->SetInteger("left", bounds.x()); | 93 new_bounds->SetInteger("left", bounds.x()); |
92 new_bounds->SetInteger("top", bounds.y()); | 94 new_bounds->SetInteger("top", bounds.y()); |
93 new_bounds->SetInteger("width", bounds.width()); | 95 new_bounds->SetInteger("width", bounds.width()); |
94 new_bounds->SetInteger("height", bounds.height()); | 96 new_bounds->SetInteger("height", bounds.height()); |
95 event_args->Append(new_bounds.release()); | 97 event_args->Append(new_bounds.release()); |
96 | 98 |
97 scoped_ptr<extensions::Event> event(new extensions::Event( | 99 scoped_ptr<extensions::Event> event(new extensions::Event( |
98 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED, | 100 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED, |
99 virtual_keyboard_private::OnBoundsChanged::kEventName, | 101 virtual_keyboard_private::OnBoundsChanged::kEventName, |
100 event_args.Pass())); | 102 std::move(event_args))); |
101 event->restrict_to_browser_context = context_; | 103 event->restrict_to_browser_context = context_; |
102 router->BroadcastEvent(event.Pass()); | 104 router->BroadcastEvent(std::move(event)); |
103 } | 105 } |
104 | 106 |
105 private: | 107 private: |
106 content::BrowserContext* context_; | 108 content::BrowserContext* context_; |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(AshKeyboardControllerObserver); | 110 DISALLOW_COPY_AND_ASSIGN(AshKeyboardControllerObserver); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace | 113 } // namespace |
112 | 114 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 scoped_ptr<base::ListValue> event_args(new base::ListValue()); | 213 scoped_ptr<base::ListValue> event_args(new base::ListValue()); |
212 scoped_ptr<base::DictionaryValue> input_context(new base::DictionaryValue()); | 214 scoped_ptr<base::DictionaryValue> input_context(new base::DictionaryValue()); |
213 input_context->SetString("type", | 215 input_context->SetString("type", |
214 virtual_keyboard_private::ToString( | 216 virtual_keyboard_private::ToString( |
215 TextInputTypeToGeneratedInputTypeEnum(type))); | 217 TextInputTypeToGeneratedInputTypeEnum(type))); |
216 event_args->Append(input_context.release()); | 218 event_args->Append(input_context.release()); |
217 | 219 |
218 scoped_ptr<extensions::Event> event(new extensions::Event( | 220 scoped_ptr<extensions::Event> event(new extensions::Event( |
219 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, | 221 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, |
220 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 222 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
221 event_args.Pass())); | 223 std::move(event_args))); |
222 event->restrict_to_browser_context = browser_context(); | 224 event->restrict_to_browser_context = browser_context(); |
223 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); | 225 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, |
| 226 std::move(event)); |
224 } | 227 } |
OLD | NEW |