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

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

Issue 12226022: <webview>: Store <webview> embedder info in ExtensionRendererState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 int x, 830 int x,
831 int y, 831 int y,
832 const base::Callback<void(RenderViewHost*, int, int)>& callback) { 832 const base::Callback<void(RenderViewHost*, int, int)>& callback) {
833 BrowserPluginEmbedder* embedder = GetBrowserPluginEmbedder(); 833 BrowserPluginEmbedder* embedder = GetBrowserPluginEmbedder();
834 if (embedder) 834 if (embedder)
835 embedder->GetRenderViewHostAtPosition(x, y, callback); 835 embedder->GetRenderViewHostAtPosition(x, y, callback);
836 else 836 else
837 callback.Run(GetRenderViewHost(), x, y); 837 callback.Run(GetRenderViewHost(), x, y);
838 } 838 }
839 839
840 WebContents* WebContentsImpl::GetEmbedderWebContents() const {
841 BrowserPluginGuest* guest = GetBrowserPluginGuest();
842 if (guest)
843 return guest->embedder_web_contents();
844 return NULL;
845 }
846
847 int WebContentsImpl::GetInstanceID() const {
848 BrowserPluginGuest* guest = GetBrowserPluginGuest();
849 if (guest)
850 return guest->instance_id();
851 return 0;
852 }
853
840 int WebContentsImpl::GetRoutingID() const { 854 int WebContentsImpl::GetRoutingID() const {
841 if (!GetRenderViewHost()) 855 if (!GetRenderViewHost())
842 return MSG_ROUTING_NONE; 856 return MSG_ROUTING_NONE;
843 857
844 return GetRenderViewHost()->GetRoutingID(); 858 return GetRenderViewHost()->GetRoutingID();
845 } 859 }
846 860
847 int WebContentsImpl::GetFullscreenWidgetRoutingID() const { 861 int WebContentsImpl::GetFullscreenWidgetRoutingID() const {
848 return fullscreen_widget_routing_id_; 862 return fullscreen_widget_routing_id_;
849 } 863 }
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); 3457 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh);
3444 // Can be NULL during tests. 3458 // Can be NULL during tests.
3445 if (rwh_view) 3459 if (rwh_view)
3446 rwh_view->SetSize(GetView()->GetContainerSize()); 3460 rwh_view->SetSize(GetView()->GetContainerSize());
3447 } 3461 }
3448 3462
3449 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { 3463 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() {
3450 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); 3464 return static_cast<RenderViewHostImpl*>(GetRenderViewHost());
3451 } 3465 }
3452 3466
3453 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3467 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const {
3454 return browser_plugin_guest_.get(); 3468 return browser_plugin_guest_.get();
3455 } 3469 }
3456 3470
3457 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3471 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() const {
3458 return browser_plugin_embedder_.get(); 3472 return browser_plugin_embedder_.get();
3459 } 3473 }
3460 3474
3461 } // namespace content 3475 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698