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

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

Issue 9609008: Implemented Browser Plugin (NOT FOR REVIEW) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: New BrowserPluginSerializationRules. Removed unnecessary changes to VarTracker 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" 17 #include "content/browser/browser_plugin/browser_plugin_host.h"
18 #include "content/browser/child_process_security_policy_impl.h" 18 #include "content/browser/child_process_security_policy_impl.h"
19 #include "content/browser/debugger/devtools_manager_impl.h" 19 #include "content/browser/debugger/devtools_manager_impl.h"
20 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 20 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
21 #include "content/browser/download/download_stats.h" 21 #include "content/browser/download/download_stats.h"
22 #include "content/browser/download/mhtml_generation_manager.h" 22 #include "content/browser/download/mhtml_generation_manager.h"
23 #include "content/browser/download/save_package.h" 23 #include "content/browser/download/save_package.h"
24 #include "content/browser/gpu/gpu_data_manager_impl.h" 24 #include "content/browser/gpu/gpu_data_manager_impl.h"
25 #include "content/browser/gpu/gpu_process_host.h" 25 #include "content/browser/gpu/gpu_process_host.h"
26 #include "content/browser/host_zoom_map_impl.h" 26 #include "content/browser/host_zoom_map_impl.h"
27 #include "content/browser/intents/web_intents_dispatcher_impl.h" 27 #include "content/browser/intents/web_intents_dispatcher_impl.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 if (opener_) { 321 if (opener_) {
322 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, 322 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
323 content::Source<WebContents>(opener_)); 323 content::Source<WebContents>(opener_));
324 } 324 }
325 325
326 #if defined(ENABLE_JAVA_BRIDGE) 326 #if defined(ENABLE_JAVA_BRIDGE)
327 java_bridge_dispatcher_host_manager_.reset( 327 java_bridge_dispatcher_host_manager_.reset(
328 new JavaBridgeDispatcherHostManager(this)); 328 new JavaBridgeDispatcherHostManager(this));
329 #endif 329 #endif
330 330
331 browser_plugin_web_contents_observer_.reset( 331 browser_plugin_host_.reset(new content::BrowserPluginHost(this));
332 new content::BrowserPluginWebContentsObserver(this));
333 } 332 }
334 333
335 WebContentsImpl::~WebContentsImpl() { 334 WebContentsImpl::~WebContentsImpl() {
336 is_being_destroyed_ = true; 335 is_being_destroyed_ = true;
337 336
338 // Clear out any JavaScript state. 337 // Clear out any JavaScript state.
339 if (dialog_creator_) 338 if (dialog_creator_)
340 dialog_creator_->ResetJavaScriptState(this); 339 dialog_creator_->ResetJavaScriptState(this);
341 340
342 if (color_chooser_) 341 if (color_chooser_)
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 666
668 content::RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { 667 content::RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const {
669 RenderViewHostImpl* host = render_manager_.current_host(); 668 RenderViewHostImpl* host = render_manager_.current_host();
670 return host ? host->GetProcess() : NULL; 669 return host ? host->GetProcess() : NULL;
671 } 670 }
672 671
673 RenderViewHost* WebContentsImpl::GetRenderViewHost() const { 672 RenderViewHost* WebContentsImpl::GetRenderViewHost() const {
674 return render_manager_.current_host(); 673 return render_manager_.current_host();
675 } 674 }
676 675
676 RenderViewHost* WebContentsImpl::GetPendingRenderViewHost() const {
677 return render_manager_.pending_render_view_host();
678 }
679
677 RenderWidgetHostView* WebContentsImpl::GetRenderWidgetHostView() const { 680 RenderWidgetHostView* WebContentsImpl::GetRenderWidgetHostView() const {
678 return render_manager_.GetRenderWidgetHostView(); 681 return render_manager_.GetRenderWidgetHostView();
679 } 682 }
680 683
681 content::WebContentsView* WebContentsImpl::GetView() const { 684 content::WebContentsView* WebContentsImpl::GetView() const {
682 return view_.get(); 685 return view_.get();
683 } 686 }
684 687
685 content::WebUI* WebContentsImpl::CreateWebUI(const GURL& url) { 688 content::WebUI* WebContentsImpl::CreateWebUI(const GURL& url) {
686 WebUIControllerFactory* factory = 689 WebUIControllerFactory* factory =
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 2668
2666 // Now that the RenderView has been created, we need to tell it its size. 2669 // Now that the RenderView has been created, we need to tell it its size.
2667 if (rwh_view) 2670 if (rwh_view)
2668 rwh_view->SetSize(view_->GetContainerSize()); 2671 rwh_view->SetSize(view_->GetContainerSize());
2669 2672
2670 // Make sure we use the correct starting page_id in the new RenderView. 2673 // Make sure we use the correct starting page_id in the new RenderView.
2671 UpdateMaxPageIDIfNecessary(render_view_host); 2674 UpdateMaxPageIDIfNecessary(render_view_host);
2672 int32 max_page_id = 2675 int32 max_page_id =
2673 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 2676 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
2674 2677
2678 WebContentsImpl* embedder = browser_plugin_host()->embedder();
2679 int embedder_process_id =
2680 embedder ? embedder->GetRenderProcessHost()->GetID() : -1;
2681 if (embedder)
2682 embedder_process_id = embedder->GetRenderProcessHost()->GetID();
2675 if (!static_cast<RenderViewHostImpl*>( 2683 if (!static_cast<RenderViewHostImpl*>(
2676 render_view_host)->CreateRenderView(string16(), opener_route_id, 2684 render_view_host)->CreateRenderView(string16(),
2677 max_page_id)) { 2685 opener_route_id,
2686 max_page_id,
2687 embedder_process_id)) {
2678 return false; 2688 return false;
2679 } 2689 }
2680 2690
2681 #if defined(OS_LINUX) || defined(OS_OPENBSD) 2691 #if defined(OS_LINUX) || defined(OS_OPENBSD)
2682 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 2692 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
2683 // linux. See crbug.com/83941. 2693 // linux. See crbug.com/83941.
2684 if (rwh_view) { 2694 if (rwh_view) {
2685 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 2695 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
2686 render_widget_host->WasResized(); 2696 render_widget_host->WasResized();
2687 } 2697 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2748 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2739 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 2749 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
2740 // Can be NULL during tests. 2750 // Can be NULL during tests.
2741 if (rwh_view) 2751 if (rwh_view)
2742 rwh_view->SetSize(GetView()->GetContainerSize()); 2752 rwh_view->SetSize(GetView()->GetContainerSize());
2743 } 2753 }
2744 2754
2745 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 2755 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
2746 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 2756 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
2747 } 2757 }
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698