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 "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // icons. | 32 // icons. |
33 AppIndicatorIcon(std::string id, | 33 AppIndicatorIcon(std::string id, |
34 const gfx::ImageSkia& image, | 34 const gfx::ImageSkia& image, |
35 const base::string16& tool_tip); | 35 const base::string16& tool_tip); |
36 virtual ~AppIndicatorIcon(); | 36 virtual ~AppIndicatorIcon(); |
37 | 37 |
38 // Indicates whether libappindicator so could be opened. | 38 // Indicates whether libappindicator so could be opened. |
39 static bool CouldOpen(); | 39 static bool CouldOpen(); |
40 | 40 |
41 // Overridden from views::StatusIconLinux: | 41 // Overridden from views::StatusIconLinux: |
42 virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; | 42 virtual void SetImage(const gfx::ImageSkia& image) override; |
43 virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; | 43 virtual void SetToolTip(const base::string16& tool_tip) override; |
44 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; | 44 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) override; |
45 virtual void RefreshPlatformContextMenu() OVERRIDE; | 45 virtual void RefreshPlatformContextMenu() override; |
46 | 46 |
47 private: | 47 private: |
48 void SetImageFromFile(const base::FilePath& icon_file_path); | 48 void SetImageFromFile(const base::FilePath& icon_file_path); |
49 void SetMenu(); | 49 void SetMenu(); |
50 | 50 |
51 // Sets a menu item at the top of the menu as a replacement for the status | 51 // Sets a menu item at the top of the menu as a replacement for the status |
52 // icon click action. Clicking on this menu item should simulate a status icon | 52 // icon click action. Clicking on this menu item should simulate a status icon |
53 // click by despatching a click event. | 53 // click by despatching a click event. |
54 void UpdateClickActionReplacementMenuItem(); | 54 void UpdateClickActionReplacementMenuItem(); |
55 | 55 |
(...skipping 16 matching lines...) Expand all Loading... |
72 int icon_change_count_; | 72 int icon_change_count_; |
73 | 73 |
74 base::WeakPtrFactory<AppIndicatorIcon> weak_factory_; | 74 base::WeakPtrFactory<AppIndicatorIcon> weak_factory_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon); | 76 DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace libgtk2ui | 79 } // namespace libgtk2ui |
80 | 80 |
81 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ | 81 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ |
OLD | NEW |