| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "content/browser/frame_host/render_frame_proxy_host.h" | 50 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 51 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 51 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 52 #include "content/browser/geolocation/geolocation_service_context.h" | 52 #include "content/browser/geolocation/geolocation_service_context.h" |
| 53 #include "content/browser/host_zoom_map_impl.h" | 53 #include "content/browser/host_zoom_map_impl.h" |
| 54 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 54 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 55 #include "content/browser/manifest/manifest_manager_host.h" | 55 #include "content/browser/manifest/manifest_manager_host.h" |
| 56 #include "content/browser/media/audio_stream_monitor.h" | 56 #include "content/browser/media/audio_stream_monitor.h" |
| 57 #include "content/browser/media/capture/web_contents_audio_muter.h" | 57 #include "content/browser/media/capture/web_contents_audio_muter.h" |
| 58 #include "content/browser/media/media_web_contents_observer.h" | 58 #include "content/browser/media/media_web_contents_observer.h" |
| 59 #include "content/browser/media/session/media_session.h" | 59 #include "content/browser/media/session/media_session.h" |
| 60 #include "content/browser/media/session/pepper_web_contents_observer.h" |
| 60 #include "content/browser/message_port_message_filter.h" | 61 #include "content/browser/message_port_message_filter.h" |
| 61 #include "content/browser/plugin_content_origin_whitelist.h" | 62 #include "content/browser/plugin_content_origin_whitelist.h" |
| 62 #include "content/browser/renderer_host/render_process_host_impl.h" | 63 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 63 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 64 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 64 #include "content/browser/renderer_host/render_view_host_impl.h" | 65 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 65 #include "content/browser/renderer_host/render_widget_host_impl.h" | 66 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 66 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 67 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 67 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 68 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 68 #include "content/browser/renderer_host/text_input_manager.h" | 69 #include "content/browser/renderer_host/text_input_manager.h" |
| 69 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" | 70 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 loading_weak_factory_(this), | 421 loading_weak_factory_(this), |
| 421 weak_factory_(this) { | 422 weak_factory_(this) { |
| 422 frame_tree_.SetFrameRemoveListener( | 423 frame_tree_.SetFrameRemoveListener( |
| 423 base::Bind(&WebContentsImpl::OnFrameRemoved, | 424 base::Bind(&WebContentsImpl::OnFrameRemoved, |
| 424 base::Unretained(this))); | 425 base::Unretained(this))); |
| 425 #if defined(OS_ANDROID) | 426 #if defined(OS_ANDROID) |
| 426 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); | 427 media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this)); |
| 427 #else | 428 #else |
| 428 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 429 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
| 429 #endif | 430 #endif |
| 431 #if defined(ENABLE_PLUGINS) |
| 432 pepper_web_contents_observer_.reset(new PepperWebContentsObserver(this)); |
| 433 #endif |
| 430 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); | 434 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); |
| 431 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); | 435 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
| 432 } | 436 } |
| 433 | 437 |
| 434 WebContentsImpl::~WebContentsImpl() { | 438 WebContentsImpl::~WebContentsImpl() { |
| 435 is_being_destroyed_ = true; | 439 is_being_destroyed_ = true; |
| 436 | 440 |
| 437 rwh_input_event_router_.reset(); | 441 rwh_input_event_router_.reset(); |
| 438 | 442 |
| 439 for (FrameTreeNode* node : frame_tree_.Nodes()) { | 443 for (FrameTreeNode* node : frame_tree_.Nodes()) { |
| (...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3692 // This exists for render views that don't have a WebUI, but do have WebUI | 3696 // This exists for render views that don't have a WebUI, but do have WebUI |
| 3693 // bindings enabled. | 3697 // bindings enabled. |
| 3694 void WebContentsImpl::OnWebUISend(const GURL& source_url, | 3698 void WebContentsImpl::OnWebUISend(const GURL& source_url, |
| 3695 const std::string& name, | 3699 const std::string& name, |
| 3696 const base::ListValue& args) { | 3700 const base::ListValue& args) { |
| 3697 if (delegate_) | 3701 if (delegate_) |
| 3698 delegate_->WebUISend(this, source_url, name, args); | 3702 delegate_->WebUISend(this, source_url, name, args); |
| 3699 } | 3703 } |
| 3700 | 3704 |
| 3701 #if defined(ENABLE_PLUGINS) | 3705 #if defined(ENABLE_PLUGINS) |
| 3702 void WebContentsImpl::OnPepperInstanceCreated() { | 3706 void WebContentsImpl::OnPepperInstanceCreated(int32_t pp_instance) { |
| 3703 FOR_EACH_OBSERVER(WebContentsObserver, observers_, PepperInstanceCreated()); | 3707 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3708 PepperInstanceCreated(pp_instance)); |
| 3704 } | 3709 } |
| 3705 | 3710 |
| 3706 void WebContentsImpl::OnPepperInstanceDeleted() { | 3711 void WebContentsImpl::OnPepperInstanceDeleted(int32_t pp_instance) { |
| 3707 FOR_EACH_OBSERVER(WebContentsObserver, observers_, PepperInstanceDeleted()); | 3712 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3713 PepperInstanceDeleted(pp_instance)); |
| 3708 } | 3714 } |
| 3709 | 3715 |
| 3710 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, | 3716 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, |
| 3711 const base::FilePath& path, | 3717 const base::FilePath& path, |
| 3712 bool is_hung) { | 3718 bool is_hung) { |
| 3713 UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); | 3719 UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); |
| 3714 | 3720 |
| 3715 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3716 PluginHungStatusChanged(plugin_child_id, path, is_hung)); | 3722 PluginHungStatusChanged(plugin_child_id, path, is_hung)); |
| 3717 } | 3723 } |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5125 for (RenderViewHost* render_view_host : render_view_host_set) | 5131 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5126 render_view_host->OnWebkitPreferencesChanged(); | 5132 render_view_host->OnWebkitPreferencesChanged(); |
| 5127 } | 5133 } |
| 5128 | 5134 |
| 5129 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5135 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
| 5130 JavaScriptDialogManager* dialog_manager) { | 5136 JavaScriptDialogManager* dialog_manager) { |
| 5131 dialog_manager_ = dialog_manager; | 5137 dialog_manager_ = dialog_manager; |
| 5132 } | 5138 } |
| 5133 | 5139 |
| 5134 } // namespace content | 5140 } // namespace content |
| OLD | NEW |