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_STAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
9 | 10 |
10 class Browser; | 11 class Browser; |
11 class CommandUpdater; | 12 class CommandUpdater; |
12 | 13 |
13 // The star icon to show a bookmark bubble. | 14 // The star icon to show a bookmark bubble. |
14 class StarView : public BubbleIconView { | 15 class StarView : public BubbleIconView { |
15 public: | 16 public: |
16 StarView(CommandUpdater* command_updater, Browser* browser); | 17 StarView(CommandUpdater* command_updater, Browser* browser); |
17 ~StarView() override; | 18 ~StarView() override; |
18 | 19 |
19 // Toggles the star on or off. | 20 // Toggles the star on or off. |
20 void SetToggled(bool on); | 21 void SetToggled(bool on); |
21 | 22 |
22 protected: | 23 protected: |
23 // BubbleIconView: | 24 // BubbleIconView: |
24 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; | 25 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; |
25 void ExecuteCommand(ExecuteSource source) override; | 26 void ExecuteCommand(ExecuteSource source) override; |
26 views::BubbleDelegateView* GetBubble() const override; | 27 views::BubbleDelegateView* GetBubble() const override; |
27 bool SetRasterIcon() override; | 28 bool SetRasterIcon() override; |
28 gfx::VectorIconId GetVectorIcon() const override; | 29 gfx::VectorIconId GetVectorIcon() const override; |
29 | 30 |
30 private: | 31 private: |
31 Browser* browser_; | 32 Browser* browser_; |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(StarView); | 34 DISALLOW_COPY_AND_ASSIGN(StarView); |
34 }; | 35 }; |
35 | 36 |
36 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ | 37 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ |
OLD | NEW |