| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dom_operation_notification_details.h" | 8 #include "chrome/browser/dom_operation_notification_details.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/net/predictor_api.h" | 10 #include "chrome/browser/net/predictor_api.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const GURL& url = params.url; | 41 const GURL& url = params.url; |
| 42 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && | 42 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame) && |
| 43 (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme))) | 43 (url.SchemeIs(chrome::kHttpScheme) || url.SchemeIs(chrome::kHttpsScheme))) |
| 44 chrome_browser_net::PreconnectUrlAndSubresources(url); | 44 chrome_browser_net::PreconnectUrlAndSubresources(url); |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool ChromeRenderViewHostObserver::OnMessageReceived( | 47 bool ChromeRenderViewHostObserver::OnMessageReceived( |
| 48 const IPC::Message& message) { | 48 const IPC::Message& message) { |
| 49 bool handled = true; | 49 bool handled = true; |
| 50 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewHostObserver, message) | 50 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewHostObserver, message) |
| 51 IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse, | 51 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DomOperationResponse, |
| 52 OnDomOperationResponse) | 52 OnDomOperationResponse) |
| 53 IPC_MESSAGE_UNHANDLED(handled = false) | 53 IPC_MESSAGE_UNHANDLED(handled = false) |
| 54 IPC_END_MESSAGE_MAP() | 54 IPC_END_MESSAGE_MAP() |
| 55 return handled; | 55 return handled; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ChromeRenderViewHostObserver::InitRenderViewHostForExtensions() { | 58 void ChromeRenderViewHostObserver::InitRenderViewHostForExtensions() { |
| 59 const Extension* extension = GetExtension(); | 59 const Extension* extension = GetExtension(); |
| 60 if (!extension) | 60 if (!extension) |
| 61 return; | 61 return; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 void ChromeRenderViewHostObserver::OnDomOperationResponse( | 155 void ChromeRenderViewHostObserver::OnDomOperationResponse( |
| 156 const std::string& json_string, int automation_id) { | 156 const std::string& json_string, int automation_id) { |
| 157 DomOperationNotificationDetails details(json_string, automation_id); | 157 DomOperationNotificationDetails details(json_string, automation_id); |
| 158 NotificationService::current()->Notify( | 158 NotificationService::current()->Notify( |
| 159 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, | 159 chrome::NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 160 Source<RenderViewHost>(render_view_host()), | 160 Source<RenderViewHost>(render_view_host()), |
| 161 Details<DomOperationNotificationDetails>(&details)); | 161 Details<DomOperationNotificationDetails>(&details)); |
| 162 } | 162 } |
| OLD | NEW |