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

Unified Diff: ui/views/controls/webview/webview.cc

Issue 12334073: Remove WebContents methods that duplicate WebContentsView methods. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/shell_web_contents_view_delegate_win.cc ('k') | ui/views/examples/webview_example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/webview/webview.cc
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index 0edd781be8915c1f335ffda9875a75cc0aa16e3c..54a74ad6a86f8d102e17d0e2aa8fd136b4081381 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -13,6 +13,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#include "ipc/ipc_message.h"
#include "ui/base/accessibility/accessibility_types.h"
#include "ui/base/accessibility/accessible_view_state.h"
@@ -121,7 +122,7 @@ bool WebView::IsFocusable() const {
void WebView::OnFocus() {
if (web_contents_)
- web_contents_->Focus();
+ web_contents_->GetView()->Focus();
}
void WebView::AboutToRequestFocusFromTabTraversal(bool reverse) {
@@ -187,19 +188,19 @@ void WebView::AttachWebContents() {
// Prevents attachment if the WebView isn't already in a Widget, or it's
// already attached.
if (!GetWidget() || !web_contents_ ||
- wcv_holder_->native_view() == web_contents_->GetNativeView()) {
+ wcv_holder_->native_view() == web_contents_->GetView()->GetNativeView()) {
return;
}
if (web_contents_) {
- wcv_holder_->Attach(web_contents_->GetNativeView());
+ wcv_holder_->Attach(web_contents_->GetView()->GetNativeView());
// The WebContentsView will not be focused automatically when it is
// attached, so we need to pass on focus to it if the FocusManager thinks
// the WebView is focused. Note that not every Widget has a focus manager.
FocusManager* focus_manager = GetFocusManager();
if (focus_manager && focus_manager->GetFocusedView() == this)
- web_contents_->Focus();
+ web_contents_->GetView()->Focus();
registrar_.Add(
this,
@@ -224,7 +225,7 @@ void WebView::DetachWebContents() {
//
// Moving this out of here would also mean we wouldn't be potentially
// calling member functions on a half-destroyed WebContents.
- ShowWindow(web_contents_->GetNativeView(), SW_HIDE);
+ ShowWindow(web_contents_->GetView()->GetNativeView(), SW_HIDE);
#endif
}
registrar_.RemoveAll();
@@ -233,7 +234,7 @@ void WebView::DetachWebContents() {
void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) {
if (GetFocusManager()->GetFocusedView() == this)
- web_contents_->Focus();
+ web_contents_->GetView()->Focus();
}
void WebView::WebContentsDestroyed(content::WebContents* web_contents) {
« no previous file with comments | « content/shell/shell_web_contents_view_delegate_win.cc ('k') | ui/views/examples/webview_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698