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 22 matching lines...) Expand all Loading... |
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 SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; | |
44 virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; | 43 virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; |
45 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; | 44 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; |
46 virtual void RefreshPlatformContextMenu() OVERRIDE; | 45 virtual void RefreshPlatformContextMenu() OVERRIDE; |
47 | 46 |
48 private: | 47 private: |
49 void SetImageFromFile(const base::FilePath& icon_file_path); | 48 void SetImageFromFile(const base::FilePath& icon_file_path); |
50 void SetMenu(); | 49 void SetMenu(); |
51 | 50 |
52 // 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 |
53 // 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 |
(...skipping 19 matching lines...) Expand all Loading... |
73 int icon_change_count_; | 72 int icon_change_count_; |
74 | 73 |
75 base::WeakPtrFactory<AppIndicatorIcon> weak_factory_; | 74 base::WeakPtrFactory<AppIndicatorIcon> weak_factory_; |
76 | 75 |
77 DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon); | 76 DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon); |
78 }; | 77 }; |
79 | 78 |
80 } // namespace libgtk2ui | 79 } // namespace libgtk2ui |
81 | 80 |
82 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ | 81 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_ |
OLD | NEW |