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 ExtensionService; | 11 class ActionBoxMenu; |
12 class Browser; | |
13 class Profile; | |
12 | 14 |
13 // ActionBoxButtonView displays a plus button with associated menu. | 15 // ActionBoxButtonView displays a plus button with associated menu. |
14 class ActionBoxButtonView : public views::MenuButton, | 16 class ActionBoxButtonView : public views::MenuButton, |
15 public views::MenuButtonListener { | 17 public views::MenuButtonListener { |
16 public: | 18 public: |
17 explicit ActionBoxButtonView(ExtensionService* extension_service); | 19 class Delegate { |
20 public: | |
21 virtual Browser* GetBrowser() const = 0; | |
22 | |
23 protected: | |
24 Delegate() {} | |
Peter Kasting
2012/07/14 02:08:01
Nit: No need to supply the constructor.
yefimt
2012/07/17 18:20:37
Done.
| |
25 ~Delegate() {} | |
26 }; | |
27 | |
28 explicit ActionBoxButtonView(Profile* profile, | |
29 Delegate* delegate); | |
18 virtual ~ActionBoxButtonView(); | 30 virtual ~ActionBoxButtonView(); |
19 | 31 |
20 SkColor GetBackgroundColor(); | 32 SkColor GetBackgroundColor(); |
21 SkColor GetBorderColor(); | 33 SkColor GetBorderColor(); |
22 | 34 |
35 void SetBookmarkState(bool on); | |
Peter Kasting
2012/07/14 02:08:01
Nit: Should be inlined and named set_bookmark_stat
yefimt
2012/07/17 18:20:37
Done.
| |
36 | |
23 private: | 37 private: |
24 // CustomButton | 38 // CustomButton |
25 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 39 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
26 | 40 |
27 // MenuButtonListener | 41 // MenuButtonListener |
28 virtual void OnMenuButtonClicked(View* source, | 42 virtual void OnMenuButtonClicked(View* source, |
29 const gfx::Point& point) OVERRIDE; | 43 const gfx::Point& point) OVERRIDE; |
30 | 44 |
31 ExtensionService* extension_service_; | 45 Profile* profile_; |
46 | |
Peter Kasting
2012/07/14 02:08:01
Nit: Remove blank lines
yefimt
2012/07/17 18:20:37
Done.
| |
47 Delegate* delegate_; | |
48 | |
49 scoped_ptr<ActionBoxMenu> action_box_menu_; | |
50 | |
51 bool bookmark_state_; | |
32 | 52 |
33 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView); | 53 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView); |
34 }; | 54 }; |
35 | 55 |
36 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ | 56 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ |
OLD | NEW |