OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TRANSLATE_TRANSLATE_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
10 | 10 |
11 class CommandUpdater; | 11 class CommandUpdater; |
12 | 12 |
13 // The location bar icon to show the Translate bubble where the user can have | 13 // The location bar icon to show the Translate bubble where the user can have |
14 // the page translated. | 14 // the page translated. |
15 class TranslateIconView : public BubbleIconView { | 15 class TranslateIconView : public BubbleIconView { |
16 public: | 16 public: |
17 explicit TranslateIconView(CommandUpdater* command_updater); | 17 explicit TranslateIconView(CommandUpdater* command_updater); |
18 ~TranslateIconView() override; | 18 ~TranslateIconView() override; |
19 | 19 |
20 // Toggles the icon on or off. | |
21 void SetToggled(bool on); | |
22 | |
23 protected: | 20 protected: |
24 // BubbleIconView: | 21 // BubbleIconView: |
25 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; | 22 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; |
26 views::BubbleDelegateView* GetBubble() const override; | 23 views::BubbleDelegateView* GetBubble() const override; |
27 gfx::VectorIconId GetVectorIcon() const override; | 24 gfx::VectorIconId GetVectorIcon() const override; |
28 | 25 |
29 private: | 26 private: |
30 DISALLOW_COPY_AND_ASSIGN(TranslateIconView); | 27 DISALLOW_COPY_AND_ASSIGN(TranslateIconView); |
31 }; | 28 }; |
32 | 29 |
33 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ | 30 #endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ |
OLD | NEW |