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

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

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_wrapper.h" 9 #include "views/controls/native/native_view_host_wrapper.h"
10 #include "views/controls/native/native_view_host_views.h" 10 #include "views/controls/native/native_view_host_views.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 if (visible) { 115 if (visible) {
116 // Since widgets know nothing about the View hierarchy (they are direct 116 // Since widgets know nothing about the View hierarchy (they are direct
117 // children of the Widget that hosts our View hierarchy) they need to be 117 // children of the Widget that hosts our View hierarchy) they need to be
118 // positioned in the coordinate system of the Widget, not the current 118 // positioned in the coordinate system of the Widget, not the current
119 // view. Also, they should be positioned respecting the border insets 119 // view. Also, they should be positioned respecting the border insets
120 // of the native view. 120 // of the native view.
121 gfx::Insets insets = GetInsets(); 121 gfx::Insets insets = GetInsets();
122 gfx::Point top_left(insets.left(), insets.top()); 122 gfx::Point top_left(insets.left(), insets.top());
123 ConvertPointToWidget(this, &top_left); 123 ConvertPointToWidget(this, &top_left);
124 gfx::Rect local_bounds = GetLocalBounds(); 124 gfx::Rect local_bounds = GetContentsBounds();
125 native_wrapper_->ShowWidget(top_left.x(), top_left.y(), 125 native_wrapper_->ShowWidget(top_left.x(), top_left.y(),
126 local_bounds.width(), 126 local_bounds.width(),
127 local_bounds.height()); 127 local_bounds.height());
128 } else { 128 } else {
129 native_wrapper_->HideWidget(); 129 native_wrapper_->HideWidget();
130 } 130 }
131 } 131 }
132 132
133 void NativeViewHost::Paint(gfx::Canvas* canvas) { 133 void NativeViewHost::Paint(gfx::Canvas* canvas) {
134 // Paint background if there is one. NativeViewHost needs to paint 134 // Paint background if there is one. NativeViewHost needs to paint
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // NativeViewHost, private: 199 // NativeViewHost, private:
200 200
201 void NativeViewHost::Detach(bool destroyed) { 201 void NativeViewHost::Detach(bool destroyed) {
202 DCHECK(native_view_ || views_view_); 202 DCHECK(native_view_ || views_view_);
203 native_wrapper_->NativeViewDetaching(destroyed); 203 native_wrapper_->NativeViewDetaching(destroyed);
204 native_view_ = NULL; 204 native_view_ = NULL;
205 views_view_ = NULL; 205 views_view_ = NULL;
206 } 206 }
207 207
208 } // namespace views 208 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698