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_LIBGTK2UI_APP_INDICATOR_ICON_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" | 10 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" |
11 #include "ui/base/models/menu_model.h" | 11 #include "ui/base/models/menu_model.h" |
12 #include "ui/linux_ui/status_icon_linux.h" | 12 #include "ui/views/linux_ui/status_icon_linux.h" |
13 | 13 |
14 typedef struct _AppIndicator AppIndicator; | 14 typedef struct _AppIndicator AppIndicator; |
15 typedef struct _GtkWidget GtkWidget; | 15 typedef struct _GtkWidget GtkWidget; |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class ImageSkia; | 18 class ImageSkia; |
19 } | 19 } |
20 | 20 |
21 namespace libgtk2ui { | 21 namespace libgtk2ui { |
22 | 22 |
23 class AppIndicatorIcon : public StatusIconLinux { | 23 class AppIndicatorIcon : public views::StatusIconLinux { |
24 public: | 24 public: |
25 // The id uniquely identifies the new status icon from other chrome status | 25 // The id uniquely identifies the new status icon from other chrome status |
26 // icons. | 26 // icons. |
27 explicit AppIndicatorIcon(std::string id, | 27 explicit AppIndicatorIcon(std::string id, |
28 const gfx::ImageSkia& image, | 28 const gfx::ImageSkia& image, |
29 const string16& tool_tip); | 29 const string16& tool_tip); |
30 virtual ~AppIndicatorIcon(); | 30 virtual ~AppIndicatorIcon(); |
31 | 31 |
32 // Indicates whether libappindicator so could be opened. | 32 // Indicates whether libappindicator so could be opened. |
33 static bool CouldOpen(); | 33 static bool CouldOpen(); |
34 | 34 |
35 // Overridden from StatusIconLinux: | 35 // Overridden from views::StatusIconLinux: |
36 virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; | 36 virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; |
37 virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; | 37 virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; |
38 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; | 38 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; |
39 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; | 39 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; |
40 virtual void RefreshPlatformContextMenu() OVERRIDE; | 40 virtual void RefreshPlatformContextMenu() OVERRIDE; |
41 | 41 |
42 private: | 42 private: |
43 void SetImageFromFile(base::FilePath icon_file_path); | 43 void SetImageFromFile(base::FilePath icon_file_path); |
44 void SetMenu(); | 44 void SetMenu(); |
45 | 45 |
(...skipping 25 matching lines...) Expand all Loading... |
71 ui::MenuModel* menu_model_; | 71 ui::MenuModel* menu_model_; |
72 | 72 |
73 base::FilePath icon_file_path_; | 73 base::FilePath icon_file_path_; |
74 int icon_change_count_; | 74 int icon_change_count_; |
75 bool block_activation_; | 75 bool block_activation_; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace libgtk2ui | 78 } // namespace libgtk2ui |
79 | 79 |
80 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ | 80 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ |
OLD | NEW |