Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10378089: Browser Plugin: Removed BrowserPluginWebContentsObserver (to be replaced by rewritten BrowserPlugi… (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "content/browser/browser_plugin/browser_plugin_web_contents_observer.h"
18 #include "content/browser/child_process_security_policy_impl.h" 17 #include "content/browser/child_process_security_policy_impl.h"
19 #include "content/browser/debugger/devtools_manager_impl.h" 18 #include "content/browser/debugger/devtools_manager_impl.h"
20 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 19 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
21 #include "content/browser/download/download_stats.h" 20 #include "content/browser/download/download_stats.h"
22 #include "content/browser/download/mhtml_generation_manager.h" 21 #include "content/browser/download/mhtml_generation_manager.h"
23 #include "content/browser/download/save_package.h" 22 #include "content/browser/download/save_package.h"
24 #include "content/browser/gpu/gpu_data_manager_impl.h" 23 #include "content/browser/gpu/gpu_data_manager_impl.h"
25 #include "content/browser/gpu/gpu_process_host.h" 24 #include "content/browser/gpu/gpu_process_host.h"
26 #include "content/browser/host_zoom_map_impl.h" 25 #include "content/browser/host_zoom_map_impl.h"
27 #include "content/browser/intents/web_intents_dispatcher_impl.h" 26 #include "content/browser/intents/web_intents_dispatcher_impl.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // Listen for whether our opener gets destroyed. 318 // Listen for whether our opener gets destroyed.
320 if (opener_) { 319 if (opener_) {
321 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 320 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
322 content::Source<WebContents>(opener_)); 321 content::Source<WebContents>(opener_));
323 } 322 }
324 323
325 #if defined(ENABLE_JAVA_BRIDGE) 324 #if defined(ENABLE_JAVA_BRIDGE)
326 java_bridge_dispatcher_host_manager_.reset( 325 java_bridge_dispatcher_host_manager_.reset(
327 new JavaBridgeDispatcherHostManager(this)); 326 new JavaBridgeDispatcherHostManager(this));
328 #endif 327 #endif
329
330 browser_plugin_web_contents_observer_.reset(
331 new content::BrowserPluginWebContentsObserver(this));
332 } 328 }
333 329
334 WebContentsImpl::~WebContentsImpl() { 330 WebContentsImpl::~WebContentsImpl() {
335 is_being_destroyed_ = true; 331 is_being_destroyed_ = true;
336 332
337 // Clear out any JavaScript state. 333 // Clear out any JavaScript state.
338 if (dialog_creator_) 334 if (dialog_creator_)
339 dialog_creator_->ResetJavaScriptState(this); 335 dialog_creator_->ResetJavaScriptState(this);
340 336
341 if (color_chooser_) 337 if (color_chooser_)
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 662
667 content::RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { 663 content::RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const {
668 RenderViewHostImpl* host = render_manager_.current_host(); 664 RenderViewHostImpl* host = render_manager_.current_host();
669 return host ? host->GetProcess() : NULL; 665 return host ? host->GetProcess() : NULL;
670 } 666 }
671 667
672 RenderViewHost* WebContentsImpl::GetRenderViewHost() const { 668 RenderViewHost* WebContentsImpl::GetRenderViewHost() const {
673 return render_manager_.current_host(); 669 return render_manager_.current_host();
674 } 670 }
675 671
672 RenderViewHost* WebContentsImpl::GetPendingRenderViewHost() const {
673 return render_manager_.pending_render_view_host();
674 }
675
676 RenderWidgetHostView* WebContentsImpl::GetRenderWidgetHostView() const { 676 RenderWidgetHostView* WebContentsImpl::GetRenderWidgetHostView() const {
677 return render_manager_.GetRenderWidgetHostView(); 677 return render_manager_.GetRenderWidgetHostView();
678 } 678 }
679 679
680 content::WebContentsView* WebContentsImpl::GetView() const { 680 content::WebContentsView* WebContentsImpl::GetView() const {
681 return view_.get(); 681 return view_.get();
682 } 682 }
683 683
684 content::WebUI* WebContentsImpl::CreateWebUI(const GURL& url) { 684 content::WebUI* WebContentsImpl::CreateWebUI(const GURL& url) {
685 WebUIControllerFactory* factory = 685 WebUIControllerFactory* factory =
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 // Now that the RenderView has been created, we need to tell it its size. 2657 // Now that the RenderView has been created, we need to tell it its size.
2658 if (rwh_view) 2658 if (rwh_view)
2659 rwh_view->SetSize(view_->GetContainerSize()); 2659 rwh_view->SetSize(view_->GetContainerSize());
2660 2660
2661 // Make sure we use the correct starting page_id in the new RenderView. 2661 // Make sure we use the correct starting page_id in the new RenderView.
2662 UpdateMaxPageIDIfNecessary(render_view_host); 2662 UpdateMaxPageIDIfNecessary(render_view_host);
2663 int32 max_page_id = 2663 int32 max_page_id =
2664 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 2664 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
2665 2665
2666 if (!static_cast<RenderViewHostImpl*>( 2666 if (!static_cast<RenderViewHostImpl*>(
2667 render_view_host)->CreateRenderView(string16(), opener_route_id, 2667 render_view_host)->CreateRenderView(string16(),
2668 max_page_id)) { 2668 opener_route_id,
2669 max_page_id,
2670 -1,
2671 MSG_ROUTING_NONE)) {
2669 return false; 2672 return false;
2670 } 2673 }
2671 2674
2672 #if defined(OS_LINUX) || defined(OS_OPENBSD) 2675 #if defined(OS_LINUX) || defined(OS_OPENBSD)
2673 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 2676 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
2674 // linux. See crbug.com/83941. 2677 // linux. See crbug.com/83941.
2675 if (rwh_view) { 2678 if (rwh_view) {
2676 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 2679 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
2677 render_widget_host->WasResized(); 2680 render_widget_host->WasResized();
2678 } 2681 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2732 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2730 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2733 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2731 // Can be NULL during tests. 2734 // Can be NULL during tests.
2732 if (rwh_view) 2735 if (rwh_view)
2733 rwh_view->SetSize(GetView()->GetContainerSize()); 2736 rwh_view->SetSize(GetView()->GetContainerSize());
2734 } 2737 }
2735 2738
2736 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2739 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2737 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2740 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2738 } 2741 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698