| 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 18 matching lines...) Expand all Loading... |
| 29 #include "content/browser/download/download_stats.h" | 29 #include "content/browser/download/download_stats.h" |
| 30 #include "content/browser/download/mhtml_generation_manager.h" | 30 #include "content/browser/download/mhtml_generation_manager.h" |
| 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/geolocation/geolocation_service_context.h" |
| 39 #include "content/browser/host_zoom_map_impl.h" | 40 #include "content/browser/host_zoom_map_impl.h" |
| 40 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 41 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 41 #include "content/browser/manifest/manifest_manager_host.h" | 42 #include "content/browser/manifest/manifest_manager_host.h" |
| 42 #include "content/browser/media/audio_stream_monitor.h" | 43 #include "content/browser/media/audio_stream_monitor.h" |
| 43 #include "content/browser/media/capture/web_contents_audio_muter.h" | 44 #include "content/browser/media/capture/web_contents_audio_muter.h" |
| 44 #include "content/browser/media/midi_dispatcher_host.h" | 45 #include "content/browser/media/midi_dispatcher_host.h" |
| 45 #include "content/browser/message_port_message_filter.h" | 46 #include "content/browser/message_port_message_filter.h" |
| 46 #include "content/browser/message_port_service.h" | 47 #include "content/browser/message_port_service.h" |
| 47 #include "content/browser/power_save_blocker_impl.h" | 48 #include "content/browser/power_save_blocker_impl.h" |
| 48 #include "content/browser/renderer_host/render_process_host_impl.h" | 49 #include "content/browser/renderer_host/render_process_host_impl.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 render_frame_id(render_frame_id), | 278 render_frame_id(render_frame_id), |
| 278 chooser(chooser), | 279 chooser(chooser), |
| 279 identifier(identifier) { | 280 identifier(identifier) { |
| 280 } | 281 } |
| 281 | 282 |
| 282 WebContentsImpl::ColorChooserInfo::~ColorChooserInfo() { | 283 WebContentsImpl::ColorChooserInfo::~ColorChooserInfo() { |
| 283 } | 284 } |
| 284 | 285 |
| 285 // WebContentsImpl ------------------------------------------------------------- | 286 // WebContentsImpl ------------------------------------------------------------- |
| 286 | 287 |
| 287 WebContentsImpl::WebContentsImpl( | 288 WebContentsImpl::WebContentsImpl(BrowserContext* browser_context, |
| 288 BrowserContext* browser_context, | 289 WebContentsImpl* opener) |
| 289 WebContentsImpl* opener) | |
| 290 : delegate_(NULL), | 290 : delegate_(NULL), |
| 291 controller_(this, browser_context), | 291 controller_(this, browser_context), |
| 292 render_view_host_delegate_view_(NULL), | 292 render_view_host_delegate_view_(NULL), |
| 293 opener_(opener), | 293 opener_(opener), |
| 294 created_with_opener_(!!opener), | 294 created_with_opener_(!!opener), |
| 295 #if defined(OS_WIN) | 295 #if defined(OS_WIN) |
| 296 accessible_parent_(NULL), | 296 accessible_parent_(NULL), |
| 297 #endif | 297 #endif |
| 298 frame_tree_(new NavigatorImpl(&controller_, this), | 298 frame_tree_(new NavigatorImpl(&controller_, this), |
| 299 this, this, this, this), | 299 this, |
| 300 this, |
| 301 this, |
| 302 this), |
| 300 is_loading_(false), | 303 is_loading_(false), |
| 301 is_load_to_different_document_(false), | 304 is_load_to_different_document_(false), |
| 302 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 305 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
| 303 crashed_error_code_(0), | 306 crashed_error_code_(0), |
| 304 waiting_for_response_(false), | 307 waiting_for_response_(false), |
| 305 load_state_(net::LOAD_STATE_IDLE, base::string16()), | 308 load_state_(net::LOAD_STATE_IDLE, base::string16()), |
| 306 loading_total_progress_(0.0), | 309 loading_total_progress_(0.0), |
| 307 loading_frames_in_progress_(0), | 310 loading_frames_in_progress_(0), |
| 308 upload_size_(0), | 311 upload_size_(0), |
| 309 upload_position_(0), | 312 upload_position_(0), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 320 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), | 323 minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)), |
| 321 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), | 324 maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)), |
| 322 totalPinchGestureAmount_(0), | 325 totalPinchGestureAmount_(0), |
| 323 currentPinchZoomStepDelta_(0), | 326 currentPinchZoomStepDelta_(0), |
| 324 render_view_message_source_(NULL), | 327 render_view_message_source_(NULL), |
| 325 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), | 328 fullscreen_widget_routing_id_(MSG_ROUTING_NONE), |
| 326 fullscreen_widget_had_focus_at_shutdown_(false), | 329 fullscreen_widget_had_focus_at_shutdown_(false), |
| 327 is_subframe_(false), | 330 is_subframe_(false), |
| 328 force_disable_overscroll_content_(false), | 331 force_disable_overscroll_content_(false), |
| 329 last_dialog_suppressed_(false), | 332 last_dialog_suppressed_(false), |
| 333 geolocation_service_context_(new GeolocationServiceContext()), |
| 330 accessibility_mode_( | 334 accessibility_mode_( |
| 331 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 335 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
| 332 audio_stream_monitor_(this), | 336 audio_stream_monitor_(this), |
| 333 loading_weak_factory_(this) { | 337 loading_weak_factory_(this) { |
| 334 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) | 338 for (size_t i = 0; i < g_created_callbacks.Get().size(); i++) |
| 335 g_created_callbacks.Get().at(i).Run(this); | 339 g_created_callbacks.Get().at(i).Run(this); |
| 336 frame_tree_.SetFrameRemoveListener( | 340 frame_tree_.SetFrameRemoveListener( |
| 337 base::Bind(&WebContentsImpl::OnFrameRemoved, | 341 base::Bind(&WebContentsImpl::OnFrameRemoved, |
| 338 base::Unretained(this))); | 342 base::Unretained(this))); |
| 339 } | 343 } |
| (...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 int browser_plugin_instance_id) { | 1793 int browser_plugin_instance_id) { |
| 1790 BrowserPluginGuestManager* guest_manager = | 1794 BrowserPluginGuestManager* guest_manager = |
| 1791 GetBrowserContext()->GetGuestManager(); | 1795 GetBrowserContext()->GetGuestManager(); |
| 1792 WebContents* guest = guest_manager->GetGuestByInstanceID( | 1796 WebContents* guest = guest_manager->GetGuestByInstanceID( |
| 1793 this, browser_plugin_instance_id); | 1797 this, browser_plugin_instance_id); |
| 1794 if (!guest) | 1798 if (!guest) |
| 1795 return NULL; | 1799 return NULL; |
| 1796 return guest->GetMainFrame(); | 1800 return guest->GetMainFrame(); |
| 1797 } | 1801 } |
| 1798 | 1802 |
| 1803 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() { |
| 1804 return geolocation_service_context_.get(); |
| 1805 } |
| 1806 |
| 1799 void WebContentsImpl::OnShowValidationMessage( | 1807 void WebContentsImpl::OnShowValidationMessage( |
| 1800 const gfx::Rect& anchor_in_root_view, | 1808 const gfx::Rect& anchor_in_root_view, |
| 1801 const base::string16& main_text, | 1809 const base::string16& main_text, |
| 1802 const base::string16& sub_text) { | 1810 const base::string16& sub_text) { |
| 1803 if (delegate_) | 1811 if (delegate_) |
| 1804 delegate_->ShowValidationMessage( | 1812 delegate_->ShowValidationMessage( |
| 1805 this, anchor_in_root_view, main_text, sub_text); | 1813 this, anchor_in_root_view, main_text, sub_text); |
| 1806 } | 1814 } |
| 1807 | 1815 |
| 1808 void WebContentsImpl::OnHideValidationMessage() { | 1816 void WebContentsImpl::OnHideValidationMessage() { |
| (...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4325 node->render_manager()->ResumeResponseDeferredAtStart(); | 4333 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4326 } | 4334 } |
| 4327 | 4335 |
| 4328 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4336 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4329 force_disable_overscroll_content_ = force_disable; | 4337 force_disable_overscroll_content_ = force_disable; |
| 4330 if (view_) | 4338 if (view_) |
| 4331 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4339 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4332 } | 4340 } |
| 4333 | 4341 |
| 4334 } // namespace content | 4342 } // namespace content |
| OLD | NEW |