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

Side by Side Diff: views/controls/native/native_view_host.cc

Issue 8573029: Fixes regression where showing bookmark bar (or download shelf) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 1 month 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
« no previous file with comments | « views/controls/native/native_view_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/native/native_view_host.h" 5 #include "views/controls/native/native_view_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "views/controls/native/native_view_host_views.h" 9 #include "views/controls/native/native_view_host_views.h"
10 #include "views/controls/native/native_view_host_wrapper.h" 10 #include "views/controls/native/native_view_host_wrapper.h"
(...skipping 13 matching lines...) Expand all
24 const bool NativeViewHost::kRenderNativeControlFocus = true; 24 const bool NativeViewHost::kRenderNativeControlFocus = true;
25 #endif 25 #endif
26 26
27 //////////////////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////////////////
28 // NativeViewHost, public: 28 // NativeViewHost, public:
29 29
30 NativeViewHost::NativeViewHost() 30 NativeViewHost::NativeViewHost()
31 : native_view_(NULL), 31 : native_view_(NULL),
32 views_view_(NULL), 32 views_view_(NULL),
33 fast_resize_(false), 33 fast_resize_(false),
34 fast_resize_at_last_layout_(false),
34 focus_view_(NULL) { 35 focus_view_(NULL) {
35 } 36 }
36 37
37 NativeViewHost::~NativeViewHost() { 38 NativeViewHost::~NativeViewHost() {
38 } 39 }
39 40
40 void NativeViewHost::Attach(gfx::NativeView native_view) { 41 void NativeViewHost::Attach(gfx::NativeView native_view) {
41 DCHECK(native_view); 42 DCHECK(native_view);
42 DCHECK(!native_view_); 43 DCHECK(!native_view_);
43 DCHECK(!views_view_); 44 DCHECK(!views_view_);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // positioned in the coordinate system of the Widget, not the current 114 // positioned in the coordinate system of the Widget, not the current
114 // view. Also, they should be positioned respecting the border insets 115 // view. Also, they should be positioned respecting the border insets
115 // of the native view. 116 // of the native view.
116 gfx::Rect local_bounds = ConvertRectToWidget(GetContentsBounds()); 117 gfx::Rect local_bounds = ConvertRectToWidget(GetContentsBounds());
117 native_wrapper_->ShowWidget(local_bounds.x(), local_bounds.y(), 118 native_wrapper_->ShowWidget(local_bounds.x(), local_bounds.y(),
118 local_bounds.width(), 119 local_bounds.width(),
119 local_bounds.height()); 120 local_bounds.height());
120 } else { 121 } else {
121 native_wrapper_->HideWidget(); 122 native_wrapper_->HideWidget();
122 } 123 }
124 fast_resize_at_last_layout_ = visible && fast_resize_;
123 } 125 }
124 126
125 void NativeViewHost::OnPaint(gfx::Canvas* canvas) { 127 void NativeViewHost::OnPaint(gfx::Canvas* canvas) {
126 // Paint background if there is one. NativeViewHost needs to paint 128 // Paint background if there is one. NativeViewHost needs to paint
127 // a background when it is hosted in a TabbedPane. For Gtk implementation, 129 // a background when it is hosted in a TabbedPane. For Gtk implementation,
128 // NativeTabbedPaneGtk uses a NativeWidgetGtk as page container and because 130 // NativeTabbedPaneGtk uses a NativeWidgetGtk as page container and because
129 // NativeWidgetGtk hook "expose" with its root view's paint, we need to 131 // NativeWidgetGtk hook "expose" with its root view's paint, we need to
130 // fill the content. Otherwise, the tab page's background is not properly 132 // fill the content. Otherwise, the tab page's background is not properly
131 // cleared. For Windows case, it appears okay to not paint background because 133 // cleared. For Windows case, it appears okay to not paint background because
132 // we don't have a container window in-between. However if you want to use 134 // we don't have a container window in-between. However if you want to use
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 198
197 void NativeViewHost::Detach(bool destroyed) { 199 void NativeViewHost::Detach(bool destroyed) {
198 if (native_view_ || views_view_) { 200 if (native_view_ || views_view_) {
199 native_wrapper_->NativeViewDetaching(destroyed); 201 native_wrapper_->NativeViewDetaching(destroyed);
200 native_view_ = NULL; 202 native_view_ = NULL;
201 views_view_ = NULL; 203 views_view_ = NULL;
202 } 204 }
203 } 205 }
204 206
205 } // namespace views 207 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native/native_view_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698