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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/browser/download/save_package.h" | 31 #include "content/browser/download/save_package.h" |
32 #include "content/browser/frame_host/cross_process_frame_connector.h" | 32 #include "content/browser/frame_host/cross_process_frame_connector.h" |
33 #include "content/browser/frame_host/interstitial_page_impl.h" | 33 #include "content/browser/frame_host/interstitial_page_impl.h" |
34 #include "content/browser/frame_host/navigation_entry_impl.h" | 34 #include "content/browser/frame_host/navigation_entry_impl.h" |
35 #include "content/browser/frame_host/navigator_impl.h" | 35 #include "content/browser/frame_host/navigator_impl.h" |
36 #include "content/browser/frame_host/render_frame_host_impl.h" | 36 #include "content/browser/frame_host/render_frame_host_impl.h" |
37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 37 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
38 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 38 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
39 #include "content/browser/host_zoom_map_impl.h" | 39 #include "content/browser/host_zoom_map_impl.h" |
40 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 40 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 41 #include "content/browser/manifest/manifest_manager_host.h" |
41 #include "content/browser/media/audio_stream_monitor.h" | 42 #include "content/browser/media/audio_stream_monitor.h" |
42 #include "content/browser/media/midi_dispatcher_host.h" | 43 #include "content/browser/media/midi_dispatcher_host.h" |
43 #include "content/browser/message_port_message_filter.h" | 44 #include "content/browser/message_port_message_filter.h" |
44 #include "content/browser/message_port_service.h" | 45 #include "content/browser/message_port_service.h" |
45 #include "content/browser/power_save_blocker_impl.h" | 46 #include "content/browser/power_save_blocker_impl.h" |
46 #include "content/browser/renderer_host/render_process_host_impl.h" | 47 #include "content/browser/renderer_host/render_process_host_impl.h" |
47 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 48 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
48 #include "content/browser/renderer_host/render_view_host_impl.h" | 49 #include "content/browser/renderer_host/render_view_host_impl.h" |
49 #include "content/browser/renderer_host/render_widget_host_impl.h" | 50 #include "content/browser/renderer_host/render_widget_host_impl.h" |
50 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 51 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 registrar_.Add(this, | 1199 registrar_.Add(this, |
1199 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 1200 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
1200 NotificationService::AllBrowserContextsAndSources()); | 1201 NotificationService::AllBrowserContextsAndSources()); |
1201 | 1202 |
1202 geolocation_dispatcher_host_.reset(new GeolocationDispatcherHost(this)); | 1203 geolocation_dispatcher_host_.reset(new GeolocationDispatcherHost(this)); |
1203 midi_dispatcher_host_.reset(new MidiDispatcherHost(this)); | 1204 midi_dispatcher_host_.reset(new MidiDispatcherHost(this)); |
1204 | 1205 |
1205 screen_orientation_dispatcher_host_.reset( | 1206 screen_orientation_dispatcher_host_.reset( |
1206 new ScreenOrientationDispatcherHost(this)); | 1207 new ScreenOrientationDispatcherHost(this)); |
1207 | 1208 |
| 1209 manifest_manager_host_.reset(new ManifestManagerHost(this)); |
| 1210 |
1208 #if defined(OS_ANDROID) | 1211 #if defined(OS_ANDROID) |
1209 date_time_chooser_.reset(new DateTimeChooserAndroid()); | 1212 date_time_chooser_.reset(new DateTimeChooserAndroid()); |
1210 #endif | 1213 #endif |
1211 } | 1214 } |
1212 | 1215 |
1213 void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) { | 1216 void WebContentsImpl::OnWebContentsDestroyed(WebContentsImpl* web_contents) { |
1214 RemoveDestructionObserver(web_contents); | 1217 RemoveDestructionObserver(web_contents); |
1215 | 1218 |
1216 // Clear the opener if it has been closed. | 1219 // Clear the opener if it has been closed. |
1217 if (web_contents == opener_) { | 1220 if (web_contents == opener_) { |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 | 2409 |
2407 void WebContentsImpl::InsertCSS(const std::string& css) { | 2410 void WebContentsImpl::InsertCSS(const std::string& css) { |
2408 GetMainFrame()->Send(new FrameMsg_CSSInsertRequest( | 2411 GetMainFrame()->Send(new FrameMsg_CSSInsertRequest( |
2409 GetMainFrame()->GetRoutingID(), css)); | 2412 GetMainFrame()->GetRoutingID(), css)); |
2410 } | 2413 } |
2411 | 2414 |
2412 bool WebContentsImpl::WasRecentlyAudible() { | 2415 bool WebContentsImpl::WasRecentlyAudible() { |
2413 return audio_stream_monitor_.WasRecentlyAudible(); | 2416 return audio_stream_monitor_.WasRecentlyAudible(); |
2414 } | 2417 } |
2415 | 2418 |
| 2419 void WebContentsImpl::GetManifest(const GetManifestCallback& callback) { |
| 2420 manifest_manager_host_->GetManifest(GetMainFrame(), callback); |
| 2421 } |
| 2422 |
2416 bool WebContentsImpl::FocusLocationBarByDefault() { | 2423 bool WebContentsImpl::FocusLocationBarByDefault() { |
2417 NavigationEntry* entry = controller_.GetVisibleEntry(); | 2424 NavigationEntry* entry = controller_.GetVisibleEntry(); |
2418 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) | 2425 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) |
2419 return true; | 2426 return true; |
2420 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); | 2427 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
2421 } | 2428 } |
2422 | 2429 |
2423 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 2430 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
2424 if (delegate_) | 2431 if (delegate_) |
2425 delegate_->SetFocusToLocationBar(select_all); | 2432 delegate_->SetFocusToLocationBar(select_all); |
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 node->render_manager()->ResumeResponseDeferredAtStart(); | 4340 node->render_manager()->ResumeResponseDeferredAtStart(); |
4334 } | 4341 } |
4335 | 4342 |
4336 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4343 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4337 force_disable_overscroll_content_ = force_disable; | 4344 force_disable_overscroll_content_ = force_disable; |
4338 if (view_) | 4345 if (view_) |
4339 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4346 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4340 } | 4347 } |
4341 | 4348 |
4342 } // namespace content | 4349 } // namespace content |
OLD | NEW |