| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/button/menu_button.h" | 5 #include "views/controls/button/menu_button.h" |
| 6 | 6 |
| 7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
| 8 #include "app/gfx/canvas.h" | 8 #include "app/gfx/canvas.h" |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 static const int64 kMinimumTimeBetweenButtonClicks = 100; | 28 static const int64 kMinimumTimeBetweenButtonClicks = 100; |
| 29 | 29 |
| 30 // The down arrow used to differentiate the menu button from normal | 30 // The down arrow used to differentiate the menu button from normal |
| 31 // text buttons. | 31 // text buttons. |
| 32 static const SkBitmap* kMenuMarker = NULL; | 32 static const SkBitmap* kMenuMarker = NULL; |
| 33 | 33 |
| 34 // How much padding to put on the left and right of the menu marker. | 34 // How much padding to put on the left and right of the menu marker. |
| 35 static const int kMenuMarkerPaddingLeft = 3; | 35 static const int kMenuMarkerPaddingLeft = 3; |
| 36 static const int kMenuMarkerPaddingRight = -1; | 36 static const int kMenuMarkerPaddingRight = -1; |
| 37 | 37 |
| 38 // static | |
| 39 const char MenuButton::kViewClassName[] = "views/MenuButton"; | |
| 40 | |
| 41 //////////////////////////////////////////////////////////////////////////////// | 38 //////////////////////////////////////////////////////////////////////////////// |
| 42 // | 39 // |
| 43 // MenuButton - constructors, destructors, initialization | 40 // MenuButton - constructors, destructors, initialization |
| 44 // | 41 // |
| 45 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| 46 | 43 |
| 47 MenuButton::MenuButton(ButtonListener* listener, | 44 MenuButton::MenuButton(ButtonListener* listener, |
| 48 const std::wstring& text, | 45 const std::wstring& text, |
| 49 ViewMenuDelegate* menu_delegate, | 46 ViewMenuDelegate* menu_delegate, |
| 50 bool show_menu_marker) | 47 bool show_menu_marker) |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 return true; | 245 return true; |
| 249 } | 246 } |
| 250 | 247 |
| 251 bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) { | 248 bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) { |
| 252 DCHECK(state); | 249 DCHECK(state); |
| 253 | 250 |
| 254 *state = AccessibilityTypes::STATE_HASPOPUP; | 251 *state = AccessibilityTypes::STATE_HASPOPUP; |
| 255 return true; | 252 return true; |
| 256 } | 253 } |
| 257 | 254 |
| 258 std::string MenuButton::GetClassName() const { | |
| 259 return kViewClassName; | |
| 260 } | |
| 261 | |
| 262 } // namespace views | 255 } // namespace views |
| OLD | NEW |