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