| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 using base::Time; | 24 using base::Time; |
| 25 using base::TimeDelta; | 25 using base::TimeDelta; |
| 26 | 26 |
| 27 namespace views { | 27 namespace views { |
| 28 | 28 |
| 29 // The amount of time, in milliseconds, we wait before allowing another mouse | 29 // The amount of time, in milliseconds, we wait before allowing another mouse |
| 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 // How much padding to put on the left and right of the menu marker. | |
| 34 static const int kMenuMarkerPaddingLeft = 3; | |
| 35 static const int kMenuMarkerPaddingRight = -1; | |
| 36 | |
| 37 // Default menu offset. | 33 // Default menu offset. |
| 38 static const int kDefaultMenuOffsetX = -2; | 34 static const int kDefaultMenuOffsetX = -2; |
| 39 static const int kDefaultMenuOffsetY = -4; | 35 static const int kDefaultMenuOffsetY = -4; |
| 40 | 36 |
| 41 // static | 37 // static |
| 38 const int MenuButton::kMenuMarkerPaddingLeft = 3; |
| 39 const int MenuButton::kMenuMarkerPaddingRight = -1; |
| 42 const char MenuButton::kViewClassName[] = "views/MenuButton"; | 40 const char MenuButton::kViewClassName[] = "views/MenuButton"; |
| 43 | 41 |
| 44 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| 45 // | 43 // |
| 46 // MenuButton - constructors, destructors, initialization | 44 // MenuButton - constructors, destructors, initialization |
| 47 // | 45 // |
| 48 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
| 49 | 47 |
| 50 MenuButton::MenuButton(ButtonListener* listener, | 48 MenuButton::MenuButton(ButtonListener* listener, |
| 51 const string16& text, | 49 const string16& text, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 if (!GetWidget()) { | 263 if (!GetWidget()) { |
| 266 NOTREACHED(); | 264 NOTREACHED(); |
| 267 return 0; | 265 return 0; |
| 268 } | 266 } |
| 269 | 267 |
| 270 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); | 268 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); |
| 271 return monitor_bounds.right() - 1; | 269 return monitor_bounds.right() - 1; |
| 272 } | 270 } |
| 273 | 271 |
| 274 } // namespace views | 272 } // namespace views |
| OLD | NEW |