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

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: Rebase to 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
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (!GetWidget()) { 267 if (!GetWidget()) {
268 NOTREACHED(); 268 NOTREACHED();
269 return 0; 269 return 0;
270 } 270 }
271 271
272 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); 272 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen();
273 return monitor_bounds.right() - 1; 273 return monitor_bounds.right() - 1;
274 } 274 }
275 275
276 } // namespace views 276 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698