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

Side by Side Diff: ui/views/controls/button/menu_button.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/button/menu_button.h ('k') | ui/views/controls/button/text_button.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/button/menu_button.h" 5 #include "ui/views/controls/button/menu_button.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/accessibility/ax_view_state.h" 10 #include "ui/accessibility/ax_view_state.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (show_menu_marker_) 139 if (show_menu_marker_)
140 PaintMenuMarker(canvas); 140 PaintMenuMarker(canvas);
141 } 141 }
142 142
143 //////////////////////////////////////////////////////////////////////////////// 143 ////////////////////////////////////////////////////////////////////////////////
144 // 144 //
145 // MenuButton - Events 145 // MenuButton - Events
146 // 146 //
147 //////////////////////////////////////////////////////////////////////////////// 147 ////////////////////////////////////////////////////////////////////////////////
148 148
149 gfx::Size MenuButton::GetPreferredSize() { 149 gfx::Size MenuButton::GetPreferredSize() const {
150 gfx::Size prefsize = TextButton::GetPreferredSize(); 150 gfx::Size prefsize = TextButton::GetPreferredSize();
151 if (show_menu_marker_) { 151 if (show_menu_marker_) {
152 prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft + 152 prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft +
153 kMenuMarkerPaddingRight, 153 kMenuMarkerPaddingRight,
154 0); 154 0);
155 } 155 }
156 return prefsize; 156 return prefsize;
157 } 157 }
158 158
159 const char* MenuButton::GetClassName() const { 159 const char* MenuButton::GetClassName() const {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (!GetWidget()) { 269 if (!GetWidget()) {
270 NOTREACHED(); 270 NOTREACHED();
271 return 0; 271 return 0;
272 } 272 }
273 273
274 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); 274 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen();
275 return monitor_bounds.right() - 1; 275 return monitor_bounds.right() - 1;
276 } 276 }
277 277
278 } // namespace views 278 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/menu_button.h ('k') | ui/views/controls/button/text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698