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/strings/utf_string_conversions.h" | 7 #include "base/strings/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 25 matching lines...) Expand all Loading... |
36 const int MenuButton::kMenuMarkerPaddingLeft = 3; | 36 const int MenuButton::kMenuMarkerPaddingLeft = 3; |
37 const int MenuButton::kMenuMarkerPaddingRight = -1; | 37 const int MenuButton::kMenuMarkerPaddingRight = -1; |
38 | 38 |
39 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
40 // | 40 // |
41 // MenuButton - constructors, destructors, initialization | 41 // MenuButton - constructors, destructors, initialization |
42 // | 42 // |
43 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
44 | 44 |
45 MenuButton::MenuButton(ButtonListener* listener, | 45 MenuButton::MenuButton(ButtonListener* listener, |
46 const string16& text, | 46 const base::string16& text, |
47 MenuButtonListener* menu_button_listener, | 47 MenuButtonListener* menu_button_listener, |
48 bool show_menu_marker) | 48 bool show_menu_marker) |
49 : TextButton(listener, text), | 49 : TextButton(listener, text), |
50 menu_visible_(false), | 50 menu_visible_(false), |
51 menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY), | 51 menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY), |
52 listener_(menu_button_listener), | 52 listener_(menu_button_listener), |
53 show_menu_marker_(show_menu_marker), | 53 show_menu_marker_(show_menu_marker), |
54 menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 54 menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
55 IDR_MENU_DROPARROW).ToImageSkia()), | 55 IDR_MENU_DROPARROW).ToImageSkia()), |
56 destroyed_flag_(NULL) { | 56 destroyed_flag_(NULL) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (!GetWidget()) { | 271 if (!GetWidget()) { |
272 NOTREACHED(); | 272 NOTREACHED(); |
273 return 0; | 273 return 0; |
274 } | 274 } |
275 | 275 |
276 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); | 276 gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen(); |
277 return monitor_bounds.right() - 1; | 277 return monitor_bounds.right() - 1; |
278 } | 278 } |
279 | 279 |
280 } // namespace views | 280 } // namespace views |
OLD | NEW |