| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |