Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ |
| 7 | 7 |
| 8 #include "ui/views/controls/button/menu_button.h" | 8 #include "ui/views/controls/button/menu_button.h" |
| 9 #include "ui/views/controls/button/menu_button_listener.h" | 9 #include "ui/views/controls/button/menu_button_listener.h" |
| 10 | 10 |
| 11 class Browser; | 11 class Browser; |
| 12 | 12 |
| 13 // ActionBoxButtonView displays a plus button with associated menu. | 13 // ActionBoxButtonView displays a plus button with associated menu. |
| 14 class ActionBoxButtonView : public views::MenuButton, | 14 class ActionBoxButtonView : public views::MenuButton, |
| 15 public views::MenuButtonListener { | 15 public views::MenuButtonListener { |
| 16 public: | 16 public: |
| 17 explicit ActionBoxButtonView(Browser* browser); | 17 explicit ActionBoxButtonView(Browser* browser); |
| 18 virtual ~ActionBoxButtonView(); | 18 virtual ~ActionBoxButtonView(); |
| 19 | 19 |
| 20 SkColor GetBackgroundColor(); | 20 SkColor GetBackgroundColor(); |
| 21 SkColor GetBorderColor(); | 21 SkColor GetBorderColor(); |
| 22 | 22 |
| 23 void SetMenuOffset(gfx::Size menu_offset) { | |
|
Peter Kasting
2012/09/14 22:21:38
Provide this as a constructor arg rather than usin
yefimt
2012/09/14 22:46:35
Done.
| |
| 24 menu_offset_ = menu_offset; | |
| 25 } | |
| 26 | |
| 23 private: | 27 private: |
| 24 // Overridden from views::CustomButton: | 28 // Overridden from views::CustomButton: |
| 25 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 29 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 26 | 30 |
| 27 // Overridden from views::MenuButtonListener: | 31 // Overridden from views::MenuButtonListener: |
| 28 virtual void OnMenuButtonClicked(View* source, | 32 virtual void OnMenuButtonClicked(View* source, |
| 29 const gfx::Point& point) OVERRIDE; | 33 const gfx::Point& point) OVERRIDE; |
| 30 | 34 |
| 31 Browser* browser_; | 35 Browser* browser_; |
| 32 | 36 |
| 37 gfx::Size menu_offset_; | |
| 38 | |
| 33 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView); | 39 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView); |
| 34 }; | 40 }; |
| 35 | 41 |
| 36 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ | 42 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ |
| OLD | NEW |