| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 MenuButton::MenuButton(ButtonListener* listener, | 49 MenuButton::MenuButton(ButtonListener* listener, |
| 50 const string16& text, | 50 const string16& text, |
| 51 MenuButtonListener* menu_button_listener, | 51 MenuButtonListener* menu_button_listener, |
| 52 bool show_menu_marker) | 52 bool show_menu_marker) |
| 53 : TextButton(listener, text), | 53 : TextButton(listener, text), |
| 54 menu_visible_(false), | 54 menu_visible_(false), |
| 55 menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY), | 55 menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY), |
| 56 listener_(menu_button_listener), | 56 listener_(menu_button_listener), |
| 57 show_menu_marker_(show_menu_marker), | 57 show_menu_marker_(show_menu_marker), |
| 58 menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 58 menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 59 IDR_MENU_DROPARROW).ToSkBitmap()), | 59 IDR_MENU_DROPARROW).ToImageSkia()), |
| 60 destroyed_flag_(NULL) { | 60 destroyed_flag_(NULL) { |
| 61 set_alignment(TextButton::ALIGN_LEFT); | 61 set_alignment(TextButton::ALIGN_LEFT); |
| 62 } | 62 } |
| 63 | 63 |
| 64 MenuButton::~MenuButton() { | 64 MenuButton::~MenuButton() { |
| 65 if (destroyed_flag_) | 65 if (destroyed_flag_) |
| 66 *destroyed_flag_ = true; | 66 *destroyed_flag_ = true; |
| 67 } | 67 } |
| 68 | 68 |
| 69 //////////////////////////////////////////////////////////////////////////////// | 69 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (!GetWidget()) { | 255 if (!GetWidget()) { |
| 256 NOTREACHED(); | 256 NOTREACHED(); |
| 257 return 0; | 257 return 0; |
| 258 } | 258 } |
| 259 | 259 |
| 260 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); | 260 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); |
| 261 return monitor_bounds.right() - 1; | 261 return monitor_bounds.right() - 1; |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace views | 264 } // namespace views |
| OLD | NEW |