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

Unified Diff: chrome/browser/ui/views/dom_view.cc

Issue 5785001: A NativeViewHostViews class for embedding views inside NativeHostView instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed up the patchset to not include files that I pulled in by accident in #3 Created 10 years 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 | « chrome/browser/ui/views/dom_view.h ('k') | chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/dom_view.cc
diff --git a/chrome/browser/ui/views/dom_view.cc b/chrome/browser/ui/views/dom_view.cc
index a4cc19af2b80485a088d903a03d5cf589cc5eb6a..cc442d3998f19b3a4faf8beb0543454b01346f65 100644
--- a/chrome/browser/ui/views/dom_view.cc
+++ b/chrome/browser/ui/views/dom_view.cc
@@ -8,6 +8,10 @@
#include "ipc/ipc_message.h"
#include "views/focus/focus_manager.h"
+#if defined(TOUCH_UI)
+#include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
+#endif
+
DOMView::DOMView() : tab_contents_(NULL), initialized_(false) {
SetFocusable(true);
}
@@ -25,7 +29,7 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) {
tab_contents_.reset(CreateTabContents(profile, instance));
// Attach the native_view now if the view is already added to Widget.
if (GetWidget())
- Attach(tab_contents_->GetNativeView());
+ AttachTabContents();
return true;
}
@@ -56,7 +60,15 @@ void DOMView::ViewHierarchyChanged(bool is_add, views::View* parent,
// the native view has not been attached yet and tab_contents_ exists.
views::NativeViewHost::ViewHierarchyChanged(is_add, parent, child);
if (is_add && GetWidget() && !native_view() && tab_contents_.get())
- Attach(tab_contents_->GetNativeView());
+ AttachTabContents();
else if (!is_add && child == this && native_view())
Detach();
}
+
+void DOMView::AttachTabContents() {
+#if defined(TOUCH_UI)
+ AttachToView(static_cast<TabContentsViewViews*>(tab_contents_->view()));
+#else
+ Attach(tab_contents_->GetNativeView());
+#endif
+}
« no previous file with comments | « chrome/browser/ui/views/dom_view.h ('k') | chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698