| 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 29 matching lines...) Expand all Loading... |
| 40 // MenuButton - constructors, destructors, initialization | 40 // MenuButton - constructors, destructors, initialization |
| 41 // | 41 // |
| 42 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| 43 | 43 |
| 44 MenuButton::MenuButton(ButtonListener* listener, | 44 MenuButton::MenuButton(ButtonListener* listener, |
| 45 const std::wstring& text, | 45 const std::wstring& text, |
| 46 ViewMenuDelegate* menu_delegate, | 46 ViewMenuDelegate* menu_delegate, |
| 47 bool show_menu_marker) | 47 bool show_menu_marker) |
| 48 : TextButton(listener, text), | 48 : TextButton(listener, text), |
| 49 menu_visible_(false), | 49 menu_visible_(false), |
| 50 menu_closed_time_(), | |
| 51 menu_delegate_(menu_delegate), | 50 menu_delegate_(menu_delegate), |
| 52 show_menu_marker_(show_menu_marker) { | 51 show_menu_marker_(show_menu_marker) { |
| 53 if (kMenuMarker == NULL) { | 52 if (kMenuMarker == NULL) { |
| 54 kMenuMarker = ResourceBundle::GetSharedInstance() | 53 kMenuMarker = ResourceBundle::GetSharedInstance() |
| 55 .GetBitmapNamed(IDR_MENU_DROPARROW); | 54 .GetBitmapNamed(IDR_MENU_DROPARROW); |
| 56 } | 55 } |
| 57 set_alignment(TextButton::ALIGN_LEFT); | 56 set_alignment(TextButton::ALIGN_LEFT); |
| 58 } | 57 } |
| 59 | 58 |
| 60 MenuButton::~MenuButton() { | 59 MenuButton::~MenuButton() { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 242 } |
| 244 | 243 |
| 245 bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) { | 244 bool MenuButton::GetAccessibleState(AccessibilityTypes::State* state) { |
| 246 DCHECK(state); | 245 DCHECK(state); |
| 247 | 246 |
| 248 *state = AccessibilityTypes::STATE_HASPOPUP; | 247 *state = AccessibilityTypes::STATE_HASPOPUP; |
| 249 return true; | 248 return true; |
| 250 } | 249 } |
| 251 | 250 |
| 252 } // namespace views | 251 } // namespace views |
| OLD | NEW |