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

Unified Diff: views/controls/native/native_view_host_views.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 | « views/controls/native/native_view_host_views.h ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/native/native_view_host_views.cc
diff --git a/views/controls/native/native_view_host_views.cc b/views/controls/native/native_view_host_views.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8a999eec5c45afb9af39c967906887164957278e
--- /dev/null
+++ b/views/controls/native/native_view_host_views.cc
@@ -0,0 +1,75 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "views/controls/native/native_view_host_views.h"
+
+#include "base/logging.h"
+#include "gfx/canvas.h"
+#include "views/controls/native/native_view_host.h"
+#include "views/focus/focus_manager.h"
+#include "views/widget/root_view.h"
+#include "views/widget/widget.h"
+
+namespace views {
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeViewHostViews, public:
+
+NativeViewHostViews::NativeViewHostViews(NativeViewHost* host)
+ : host_(host),
+ installed_clip_(false) {
+}
+
+NativeViewHostViews::~NativeViewHostViews() {
+NOTIMPLEMENTED();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// NativeViewHostViews, NativeViewHostWrapper implementation:
+void NativeViewHostViews::NativeViewAttached() {
+ host_->AddChildView(host_->views_view());
+ host_->Layout();
+}
+
+void NativeViewHostViews::NativeViewDetaching(bool destroyed) {
+ host_->RemoveChildView(host_->views_view());
+}
+
+void NativeViewHostViews::AddedToWidget() {
+ // nothing to do
+}
+
+void NativeViewHostViews::RemovedFromWidget() {
+ // nothing to do
+}
+
+void NativeViewHostViews::InstallClip(int x, int y, int w, int h) {
+ NOTIMPLEMENTED();
+}
+
+bool NativeViewHostViews::HasInstalledClip() {
+ return installed_clip_;
+}
+
+void NativeViewHostViews::UninstallClip() {
+ installed_clip_ = false;
+}
+
+void NativeViewHostViews::ShowWidget(int x, int y, int w, int h) {
+ // x, y are in the coordinate system of the root view, but we're
+ // already properly positioned by virtue of being an actual views
+ // child of the NativeHostView, so disregard the origin.
+ host_->views_view()->SetBounds(0, 0, w, h);
+ host_->views_view()->SetVisible(true);
+}
+
+void NativeViewHostViews::HideWidget() {
+ host_->views_view()->SetVisible(false);
+}
+
+void NativeViewHostViews::SetFocus() {
+ host_->views_view()->RequestFocus();
+}
+
+} // namespace views
« no previous file with comments | « views/controls/native/native_view_host_views.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698