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_resource_dispatcher_host_delegate.
h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.
h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/download/download_request_limiter.h" | 10 #include "chrome/browser/download/download_request_limiter.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/ui/login/login_prompt.h" | 24 #include "chrome/browser/ui/login/login_prompt.h" |
25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
26 #include "chrome/common/extensions/user_script.h" | 26 #include "chrome/common/extensions/user_script.h" |
27 #include "chrome/common/render_messages.h" | 27 #include "chrome/common/render_messages.h" |
28 #include "content/browser/browser_thread.h" | 28 #include "content/browser/browser_thread.h" |
29 #include "content/browser/resource_context.h" | 29 #include "content/browser/resource_context.h" |
30 #include "content/browser/renderer_host/render_view_host.h" | 30 #include "content/browser/renderer_host/render_view_host.h" |
31 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 31 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
32 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 32 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
33 #include "content/browser/renderer_host/resource_message_filter.h" | 33 #include "content/browser/renderer_host/resource_message_filter.h" |
34 #include "content/common/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
35 #include "content/common/resource_messages.h" | 35 #include "content/common/resource_messages.h" |
36 #include "net/base/load_flags.h" | 36 #include "net/base/load_flags.h" |
37 | 37 |
38 // TODO(oshima): Enable this for other platforms. | 38 // TODO(oshima): Enable this for other platforms. |
39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
40 #include "chrome/browser/renderer_host/offline_resource_handler.h" | 40 #include "chrome/browser/renderer_host/offline_resource_handler.h" |
41 #endif | 41 #endif |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
(...skipping 27 matching lines...) Expand all Loading... |
72 url, | 72 url, |
73 referrer); | 73 referrer); |
74 } | 74 } |
75 | 75 |
76 void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) { | 76 void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) { |
77 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, | 77 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, |
78 render_view_id); | 78 render_view_id); |
79 if (!rvh) | 79 if (!rvh) |
80 return; | 80 return; |
81 | 81 |
82 NotificationService::current()->Notify( | 82 content::NotificationService::current()->Notify( |
83 chrome::NOTIFICATION_DOWNLOAD_INITIATED, | 83 chrome::NOTIFICATION_DOWNLOAD_INITIATED, |
84 content::Source<RenderViewHost>(rvh), | 84 content::Source<RenderViewHost>(rvh), |
85 NotificationService::NoDetails()); | 85 content::NotificationService::NoDetails()); |
86 } | 86 } |
87 | 87 |
88 } // end namespace | 88 } // end namespace |
89 | 89 |
90 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( | 90 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( |
91 ResourceDispatcherHost* resource_dispatcher_host, | 91 ResourceDispatcherHost* resource_dispatcher_host, |
92 prerender::PrerenderTracker* prerender_tracker) | 92 prerender::PrerenderTracker* prerender_tracker) |
93 : resource_dispatcher_host_(resource_dispatcher_host), | 93 : resource_dispatcher_host_(resource_dispatcher_host), |
94 download_request_limiter_(g_browser_process->download_request_limiter()), | 94 download_request_limiter_(g_browser_process->download_request_limiter()), |
95 safe_browsing_(g_browser_process->safe_browsing_service()), | 95 safe_browsing_(g_browser_process->safe_browsing_service()), |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), | 330 AutoLoginPrompter::ShowInfoBarIfPossible(request, info->child_id(), |
331 info->route_id()); | 331 info->route_id()); |
332 } | 332 } |
333 | 333 |
334 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( | 334 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( |
335 net::URLRequest* request, | 335 net::URLRequest* request, |
336 ResourceResponse* response, | 336 ResourceResponse* response, |
337 ResourceMessageFilter* filter) { | 337 ResourceMessageFilter* filter) { |
338 LoadTimingObserver::PopulateTimingInfo(request, response); | 338 LoadTimingObserver::PopulateTimingInfo(request, response); |
339 } | 339 } |
OLD | NEW |