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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "content/browser/download/download_stats.h" | 34 #include "content/browser/download/download_stats.h" |
35 #include "content/browser/download/mhtml_generation_manager.h" | 35 #include "content/browser/download/mhtml_generation_manager.h" |
36 #include "content/browser/download/save_package.h" | 36 #include "content/browser/download/save_package.h" |
37 #include "content/browser/frame_host/cross_process_frame_connector.h" | 37 #include "content/browser/frame_host/cross_process_frame_connector.h" |
38 #include "content/browser/frame_host/interstitial_page_impl.h" | 38 #include "content/browser/frame_host/interstitial_page_impl.h" |
39 #include "content/browser/frame_host/navigation_entry_impl.h" | 39 #include "content/browser/frame_host/navigation_entry_impl.h" |
40 #include "content/browser/frame_host/navigation_handle_impl.h" | 40 #include "content/browser/frame_host/navigation_handle_impl.h" |
41 #include "content/browser/frame_host/navigator_impl.h" | 41 #include "content/browser/frame_host/navigator_impl.h" |
42 #include "content/browser/frame_host/render_frame_host_impl.h" | 42 #include "content/browser/frame_host/render_frame_host_impl.h" |
43 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 43 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
44 #include "content/browser/geolocation/geolocation_service_context.h" | |
45 #include "content/browser/host_zoom_map_impl.h" | 44 #include "content/browser/host_zoom_map_impl.h" |
46 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 45 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
47 #include "content/browser/manifest/manifest_manager_host.h" | 46 #include "content/browser/manifest/manifest_manager_host.h" |
48 #include "content/browser/media/audio_stream_monitor.h" | 47 #include "content/browser/media/audio_stream_monitor.h" |
49 #include "content/browser/media/capture/web_contents_audio_muter.h" | 48 #include "content/browser/media/capture/web_contents_audio_muter.h" |
50 #include "content/browser/message_port_message_filter.h" | 49 #include "content/browser/message_port_message_filter.h" |
51 #include "content/browser/plugin_content_origin_whitelist.h" | 50 #include "content/browser/plugin_content_origin_whitelist.h" |
52 #include "content/browser/power_save_blocker_impl.h" | 51 #include "content/browser/power_save_blocker_impl.h" |
53 #include "content/browser/renderer_host/render_process_host_impl.h" | 52 #include "content/browser/renderer_host/render_process_host_impl.h" |
54 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 53 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 closed_by_user_gesture_(false), | 395 closed_by_user_gesture_(false), |
397 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), | 396 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), |
398 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), | 397 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), |
399 render_view_message_source_(NULL), | 398 render_view_message_source_(NULL), |
400 render_frame_message_source_(NULL), | 399 render_frame_message_source_(NULL), |
401 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), | 400 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), |
402 fullscreen_widget_had_focus_at_shutdown_(false), | 401 fullscreen_widget_had_focus_at_shutdown_(false), |
403 is_subframe_(false), | 402 is_subframe_(false), |
404 force_disable_overscroll_content_(false), | 403 force_disable_overscroll_content_(false), |
405 last_dialog_suppressed_(false), | 404 last_dialog_suppressed_(false), |
406 geolocation_service_context_(new GeolocationServiceContext()), | |
407 accessibility_mode_( | 405 accessibility_mode_( |
408 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 406 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
409 audio_stream_monitor_(this), | 407 audio_stream_monitor_(this), |
410 virtual_keyboard_requested_(false), | 408 virtual_keyboard_requested_(false), |
411 page_scale_factor_is_one_(true), | 409 page_scale_factor_is_one_(true), |
412 loading_weak_factory_(this) { | 410 loading_weak_factory_(this) { |
413 frame_tree_.SetFrameRemoveListener( | 411 frame_tree_.SetFrameRemoveListener( |
414 base::Bind(&WebContentsImpl::OnFrameRemoved, | 412 base::Bind(&WebContentsImpl::OnFrameRemoved, |
415 base::Unretained(this))); | 413 base::Unretained(this))); |
416 #if defined(ENABLE_BROWSER_CDMS) | 414 #if defined(ENABLE_BROWSER_CDMS) |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 return nullptr; | 2140 return nullptr; |
2143 | 2141 |
2144 WebContents* guest = guest_manager->GetGuestByInstanceID( | 2142 WebContents* guest = guest_manager->GetGuestByInstanceID( |
2145 render_frame_host->GetProcess()->GetID(), browser_plugin_instance_id); | 2143 render_frame_host->GetProcess()->GetID(), browser_plugin_instance_id); |
2146 if (!guest) | 2144 if (!guest) |
2147 return nullptr; | 2145 return nullptr; |
2148 | 2146 |
2149 return guest->GetMainFrame(); | 2147 return guest->GetMainFrame(); |
2150 } | 2148 } |
2151 | 2149 |
2152 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() { | |
2153 return geolocation_service_context_.get(); | |
2154 } | |
2155 | |
2156 WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { | 2150 WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { |
2157 return wake_lock_service_context_.get(); | 2151 return wake_lock_service_context_.get(); |
2158 } | 2152 } |
2159 | 2153 |
2160 void WebContentsImpl::OnShowValidationMessage( | 2154 void WebContentsImpl::OnShowValidationMessage( |
2161 const gfx::Rect& anchor_in_root_view, | 2155 const gfx::Rect& anchor_in_root_view, |
2162 const base::string16& main_text, | 2156 const base::string16& main_text, |
2163 const base::string16& sub_text) { | 2157 const base::string16& sub_text) { |
2164 if (delegate_) | 2158 if (delegate_) |
2165 delegate_->ShowValidationMessage( | 2159 delegate_->ShowValidationMessage( |
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4807 return NULL; | 4801 return NULL; |
4808 } | 4802 } |
4809 | 4803 |
4810 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4804 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4811 force_disable_overscroll_content_ = force_disable; | 4805 force_disable_overscroll_content_ = force_disable; |
4812 if (view_) | 4806 if (view_) |
4813 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4807 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4814 } | 4808 } |
4815 | 4809 |
4816 } // namespace content | 4810 } // namespace content |
OLD | NEW |