| 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/net/predictor.h" | 9 #include "chrome/browser/net/predictor.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/extensions/extension_messages.h" | 13 #include "chrome/common/extensions/extension_messages.h" |
| 14 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "content/public/browser/child_process_security_policy.h" | 16 #include "content/public/browser/child_process_security_policy.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/browser/render_view_host_delegate.h" | 20 #include "content/public/browser/render_view_host_delegate.h" |
| 21 #include "content/public/browser/site_instance.h" | 21 #include "content/public/browser/site_instance.h" |
| 22 | 22 |
| 23 using content::ChildProcessSecurityPolicy; | 23 using content::ChildProcessSecurityPolicy; |
| 24 using content::RenderViewHost; | 24 using content::RenderViewHost; |
| 25 using content::SiteInstance; | 25 using content::SiteInstance; |
| 26 using extensions::Extension; |
| 26 | 27 |
| 27 ChromeRenderViewHostObserver::ChromeRenderViewHostObserver( | 28 ChromeRenderViewHostObserver::ChromeRenderViewHostObserver( |
| 28 RenderViewHost* render_view_host, chrome_browser_net::Predictor* predictor) | 29 RenderViewHost* render_view_host, chrome_browser_net::Predictor* predictor) |
| 29 : content::RenderViewHostObserver(render_view_host), | 30 : content::RenderViewHostObserver(render_view_host), |
| 30 predictor_(predictor) { | 31 predictor_(predictor) { |
| 31 SiteInstance* site_instance = render_view_host->GetSiteInstance(); | 32 SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
| 32 profile_ = Profile::FromBrowserContext( | 33 profile_ = Profile::FromBrowserContext( |
| 33 site_instance->GetBrowserContext()); | 34 site_instance->GetBrowserContext()); |
| 34 | 35 |
| 35 InitRenderViewHostForExtensions(); | 36 InitRenderViewHostForExtensions(); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (process_manager) | 175 if (process_manager) |
| 175 process_manager->UnregisterRenderViewHost(rvh); | 176 process_manager->UnregisterRenderViewHost(rvh); |
| 176 } | 177 } |
| 177 | 178 |
| 178 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { | 179 void ChromeRenderViewHostObserver::OnFocusedEditableNodeTouched() { |
| 179 content::NotificationService::current()->Notify( | 180 content::NotificationService::current()->Notify( |
| 180 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, | 181 chrome::NOTIFICATION_FOCUSED_EDITABLE_NODE_TOUCHED, |
| 181 content::Source<RenderViewHost>(render_view_host()), | 182 content::Source<RenderViewHost>(render_view_host()), |
| 182 content::NotificationService::NoDetails()); | 183 content::NotificationService::NoDetails()); |
| 183 } | 184 } |
| OLD | NEW |