OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <peninputpanel_i.c> | 8 #include <peninputpanel_i.c> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 25 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
26 #include "content/browser/plugin_process_host.h" | 26 #include "content/browser/plugin_process_host.h" |
27 #include "content/browser/renderer_host/backing_store.h" | 27 #include "content/browser/renderer_host/backing_store.h" |
28 #include "content/browser/renderer_host/backing_store_win.h" | 28 #include "content/browser/renderer_host/backing_store_win.h" |
29 #include "content/browser/renderer_host/render_process_host_impl.h" | 29 #include "content/browser/renderer_host/render_process_host_impl.h" |
30 #include "content/browser/renderer_host/render_widget_host.h" | 30 #include "content/browser/renderer_host/render_widget_host.h" |
31 #include "content/common/gpu/gpu_messages.h" | 31 #include "content/common/gpu/gpu_messages.h" |
32 #include "content/common/plugin_messages.h" | 32 #include "content/common/plugin_messages.h" |
33 #include "content/common/view_messages.h" | 33 #include "content/common/view_messages.h" |
34 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
| 35 #include "content/public/browser/child_process_data.h" |
35 #include "content/public/browser/content_browser_client.h" | 36 #include "content/public/browser/content_browser_client.h" |
36 #include "content/public/browser/native_web_keyboard_event.h" | 37 #include "content/public/browser/native_web_keyboard_event.h" |
37 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
39 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
40 #include "content/public/common/page_zoom.h" | 41 #include "content/public/common/page_zoom.h" |
41 #include "content/public/common/process_type.h" | 42 #include "content/public/common/process_type.h" |
42 #include "skia/ext/skia_utils_win.h" | 43 #include "skia/ext/skia_utils_win.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 // |window| is the plugin HWND, created and destroyed in the plugin process. | 123 // |window| is the plugin HWND, created and destroyed in the plugin process. |
123 // |parent| is the parent HWND, created and destroyed on the browser UI thread. | 124 // |parent| is the parent HWND, created and destroyed on the browser UI thread. |
124 void NotifyPluginProcessHostHelper(HWND window, HWND parent, int tries) { | 125 void NotifyPluginProcessHostHelper(HWND window, HWND parent, int tries) { |
125 // How long to wait between each try. | 126 // How long to wait between each try. |
126 static const int kTryDelayMs = 200; | 127 static const int kTryDelayMs = 200; |
127 | 128 |
128 DWORD plugin_process_id; | 129 DWORD plugin_process_id; |
129 bool found_starting_plugin_process = false; | 130 bool found_starting_plugin_process = false; |
130 GetWindowThreadProcessId(window, &plugin_process_id); | 131 GetWindowThreadProcessId(window, &plugin_process_id); |
131 for (BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_PLUGIN); | 132 for (PluginProcessHostIterator iter; !iter.Done(); ++iter) { |
132 !iter.Done(); ++iter) { | 133 if (!iter.GetData().handle) { |
133 PluginProcessHost* plugin = static_cast<PluginProcessHost*>(*iter); | |
134 if (!plugin->data().handle) { | |
135 found_starting_plugin_process = true; | 134 found_starting_plugin_process = true; |
136 continue; | 135 continue; |
137 } | 136 } |
138 if (base::GetProcId(plugin->data().handle) == plugin_process_id) { | 137 if (base::GetProcId(iter.GetData().handle) == plugin_process_id) { |
139 plugin->AddWindow(parent); | 138 iter->AddWindow(parent); |
140 return; | 139 return; |
141 } | 140 } |
142 } | 141 } |
143 | 142 |
144 if (found_starting_plugin_process) { | 143 if (found_starting_plugin_process) { |
145 // A plugin process has started but we don't have its handle yet. Since | 144 // A plugin process has started but we don't have its handle yet. Since |
146 // it's most likely the one for this plugin, try a few more times after a | 145 // it's most likely the one for this plugin, try a few more times after a |
147 // delay. | 146 // delay. |
148 if (tries > 0) { | 147 if (tries > 0) { |
149 MessageLoop::current()->PostDelayedTask( | 148 MessageLoop::current()->PostDelayedTask( |
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2569 void RenderWidgetHostViewWin::ResetPointerDownContext() { | 2568 void RenderWidgetHostViewWin::ResetPointerDownContext() { |
2570 // If the default focus on the page is on an edit field and we did not | 2569 // If the default focus on the page is on an edit field and we did not |
2571 // receive a focus change in the context of a pointer down message, it means | 2570 // receive a focus change in the context of a pointer down message, it means |
2572 // that the pointer down message occurred on the edit field and we should | 2571 // that the pointer down message occurred on the edit field and we should |
2573 // display the on screen keyboard | 2572 // display the on screen keyboard |
2574 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 2573 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
2575 DisplayOnScreenKeyboardIfNeeded(); | 2574 DisplayOnScreenKeyboardIfNeeded(); |
2576 received_focus_change_after_pointer_down_ = false; | 2575 received_focus_change_after_pointer_down_ = false; |
2577 pointer_down_context_ = false; | 2576 pointer_down_context_ = false; |
2578 } | 2577 } |
OLD | NEW |