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 "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 5 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/net/predictor.h" | 10 #include "chrome/browser/net/predictor.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/extensions/extension_messages.h" | 14 #include "chrome/common/extensions/extension_messages.h" |
15 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "content/public/browser/child_process_security_policy.h" | 17 #include "content/public/browser/child_process_security_policy.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
20 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/browser/site_instance.h" | 21 #include "content/public/browser/site_instance.h" |
22 #include "extensions/common/constants.h" | 22 #include "extensions/common/constants.h" |
23 | 23 |
| 24 #if defined(OS_WIN) |
| 25 #include "base/win/win_util.h" |
| 26 #endif // OS_WIN |
| 27 |
24 using content::ChildProcessSecurityPolicy; | 28 using content::ChildProcessSecurityPolicy; |
25 using content::RenderViewHost; | 29 using content::RenderViewHost; |
26 using content::SiteInstance; | 30 using content::SiteInstance; |
27 using extensions::Extension; | 31 using extensions::Extension; |
28 | 32 |
29 ChromeRenderViewHostObserver::ChromeRenderViewHostObserver( | 33 ChromeRenderViewHostObserver::ChromeRenderViewHostObserver( |
30 RenderViewHost* render_view_host, chrome_browser_net::Predictor* predictor) | 34 RenderViewHost* render_view_host, chrome_browser_net::Predictor* predictor) |
31 : content::RenderViewHostObserver(render_view_host), | 35 : content::RenderViewHostObserver(render_view_host), |
32 predictor_(predictor) { | 36 predictor_(predictor) { |
33 SiteInstance* site_instance = render_view_host->GetSiteInstance(); | 37 SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 void ChromeRenderViewHostObserver::RemoveRenderViewHostForExtensions( | 151 void ChromeRenderViewHostObserver::RemoveRenderViewHostForExtensions( |
148 RenderViewHost* rvh) { | 152 RenderViewHost* rvh) { |
149 ExtensionProcessManager* process_manager = | 153 ExtensionProcessManager* process_manager = |
150 extensions::ExtensionSystem::Get(profile_)->process_manager(); | 154 extensions::ExtensionSystem::Get(profile_)->process_manager(); |
151 if (process_manager) | 155 if (process_manager) |
152 process_manager->UnregisterRenderViewHost(rvh); | 156 process_manager->UnregisterRenderViewHost(rvh); |
153 } | 157 } |
154 | 158 |
155 void ChromeRenderViewHostObserver::OnFocusedNodeTouched(bool editable) { | 159 void ChromeRenderViewHostObserver::OnFocusedNodeTouched(bool editable) { |
156 if (editable) { | 160 if (editable) { |
| 161 #if defined(OS_WIN) |
| 162 base::win::DisplayVirtualKeyboard(); |
| 163 #endif |
157 content::NotificationService::current()->Notify( | 164 content::NotificationService::current()->Notify( |
158 chrome::NOTIFICATION_FOCUSED_NODE_TOUCHED, | 165 chrome::NOTIFICATION_FOCUSED_NODE_TOUCHED, |
159 content::Source<RenderViewHost>(render_view_host()), | 166 content::Source<RenderViewHost>(render_view_host()), |
160 content::Details<bool>(&editable)); | 167 content::Details<bool>(&editable)); |
| 168 } else { |
| 169 #if defined(OS_WIN) |
| 170 base::win::DismissVirtualKeyboard(); |
| 171 #endif |
161 } | 172 } |
162 } | 173 } |
OLD | NEW |