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/utf_string_conversions.h" | 7 #include "base/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/base/accessibility/accessible_view_state.h" | 10 #include "ui/base/accessibility/accessible_view_state.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // pressed event to show the menu. | 30 // pressed event to show the menu. |
31 static const int64 kMinimumTimeBetweenButtonClicks = 100; | 31 static const int64 kMinimumTimeBetweenButtonClicks = 100; |
32 | 32 |
33 // Default menu offset. | 33 // Default menu offset. |
34 static const int kDefaultMenuOffsetX = -2; | 34 static const int kDefaultMenuOffsetX = -2; |
35 static const int kDefaultMenuOffsetY = -4; | 35 static const int kDefaultMenuOffsetY = -4; |
36 | 36 |
37 // static | 37 // static |
38 const int MenuButton::kMenuMarkerPaddingLeft = 3; | 38 const int MenuButton::kMenuMarkerPaddingLeft = 3; |
39 const int MenuButton::kMenuMarkerPaddingRight = -1; | 39 const int MenuButton::kMenuMarkerPaddingRight = -1; |
40 const char MenuButton::kViewClassName[] = "views/MenuButton"; | 40 const char MenuButton::kViewClassName[] = "MenuButton"; |
41 | 41 |
42 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
43 // | 43 // |
44 // MenuButton - constructors, destructors, initialization | 44 // MenuButton - constructors, destructors, initialization |
45 // | 45 // |
46 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
47 | 47 |
48 MenuButton::MenuButton(ButtonListener* listener, | 48 MenuButton::MenuButton(ButtonListener* listener, |
49 const string16& text, | 49 const string16& text, |
50 MenuButtonListener* menu_button_listener, | 50 MenuButtonListener* menu_button_listener, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (!GetWidget()) { | 273 if (!GetWidget()) { |
274 NOTREACHED(); | 274 NOTREACHED(); |
275 return 0; | 275 return 0; |
276 } | 276 } |
277 | 277 |
278 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); | 278 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); |
279 return monitor_bounds.right() - 1; | 279 return monitor_bounds.right() - 1; |
280 } | 280 } |
281 | 281 |
282 } // namespace views | 282 } // namespace views |
OLD | NEW |