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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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
« no previous file with comments | « ui/views/controls/native/native_view_host.h ('k') | ui/views/controls/progress_bar.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/native/native_view_host.h" 5 #include "ui/views/controls/native/native_view_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/cursor/cursor.h" 8 #include "ui/base/cursor/cursor.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/accessibility/native_view_accessibility.h" 10 #include "ui/views/accessibility/native_view_accessibility.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 void NativeViewHost::NativeViewDestroyed() { 59 void NativeViewHost::NativeViewDestroyed() {
60 // Detach so we can clear our state and notify the native_wrapper_ to release 60 // Detach so we can clear our state and notify the native_wrapper_ to release
61 // ref on the native view. 61 // ref on the native view.
62 Detach(true); 62 Detach(true);
63 } 63 }
64 64
65 //////////////////////////////////////////////////////////////////////////////// 65 ////////////////////////////////////////////////////////////////////////////////
66 // NativeViewHost, View overrides: 66 // NativeViewHost, View overrides:
67 67
68 gfx::Size NativeViewHost::GetPreferredSize() { 68 gfx::Size NativeViewHost::GetPreferredSize() const {
69 return preferred_size_; 69 return preferred_size_;
70 } 70 }
71 71
72 void NativeViewHost::Layout() { 72 void NativeViewHost::Layout() {
73 if (!native_view_ || !native_wrapper_.get()) 73 if (!native_view_ || !native_wrapper_.get())
74 return; 74 return;
75 75
76 gfx::Rect vis_bounds = GetVisibleBounds(); 76 gfx::Rect vis_bounds = GetVisibleBounds();
77 bool visible = !vis_bounds.IsEmpty(); 77 bool visible = !vis_bounds.IsEmpty();
78 78
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 Widget::Widgets widgets; 215 Widget::Widgets widgets;
216 Widget::GetAllChildWidgets(native_view(), &widgets); 216 Widget::GetAllChildWidgets(native_view(), &widgets);
217 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { 217 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) {
218 focus_manager->ViewRemoved((*i)->GetRootView()); 218 focus_manager->ViewRemoved((*i)->GetRootView());
219 if (!focus_manager->GetFocusedView()) 219 if (!focus_manager->GetFocusedView())
220 return; 220 return;
221 } 221 }
222 } 222 }
223 223
224 } // namespace views 224 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/native/native_view_host.h ('k') | ui/views/controls/progress_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698