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_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const base::string16& contents, | 28 const base::string16& contents, |
29 const message_center::NotifierId& notifier_id) override; | 29 const message_center::NotifierId& notifier_id) override; |
30 | 30 |
31 // StatusIconLinux::Delegate overrides: | 31 // StatusIconLinux::Delegate overrides: |
32 void OnClick() override; | 32 void OnClick() override; |
33 bool HasClickAction() override; | 33 bool HasClickAction() override; |
34 | 34 |
35 // StatusIconMenuModel::Observer overrides: | 35 // StatusIconMenuModel::Observer overrides: |
36 void OnMenuStateChanged() override; | 36 void OnMenuStateChanged() override; |
37 | 37 |
38 static StatusIconLinuxWrapper* CreateWrappedStatusIcon( | 38 static std::unique_ptr<StatusIconLinuxWrapper> CreateWrappedStatusIcon( |
39 const gfx::ImageSkia& image, | 39 const gfx::ImageSkia& image, |
40 const base::string16& tool_tip); | 40 const base::string16& tool_tip); |
41 | 41 |
42 protected: | 42 protected: |
43 // StatusIcon overrides: | 43 // StatusIcon overrides: |
44 // Invoked after a call to SetContextMenu() to let the platform-specific | 44 // Invoked after a call to SetContextMenu() to let the platform-specific |
45 // subclass update the native context menu based on the new model. If NULL is | 45 // subclass update the native context menu based on the new model. If NULL is |
46 // passed, subclass should destroy the native context menu. | 46 // passed, subclass should destroy the native context menu. |
47 void UpdatePlatformContextMenu(StatusIconMenuModel* model) override; | 47 void UpdatePlatformContextMenu(StatusIconMenuModel* model) override; |
48 | 48 |
49 private: | 49 private: |
50 // A status icon wrapper should only be created by calling | 50 // A status icon wrapper should only be created by calling |
51 // CreateWrappedStatusIcon(). | 51 // CreateWrappedStatusIcon(). |
52 explicit StatusIconLinuxWrapper(views::StatusIconLinux* status_icon); | 52 explicit StatusIconLinuxWrapper( |
| 53 std::unique_ptr<views::StatusIconLinux> status_icon); |
53 | 54 |
54 // Notification balloon. | 55 // Notification balloon. |
55 DesktopNotificationBalloon notification_; | 56 DesktopNotificationBalloon notification_; |
56 | 57 |
57 std::unique_ptr<views::StatusIconLinux> status_icon_; | 58 std::unique_ptr<views::StatusIconLinux> status_icon_; |
58 | 59 |
59 StatusIconMenuModel* menu_model_; | 60 StatusIconMenuModel* menu_model_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(StatusIconLinuxWrapper); | 62 DISALLOW_COPY_AND_ASSIGN(StatusIconLinuxWrapper); |
62 }; | 63 }; |
63 | 64 |
64 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_STATUS_ICONS_STATUS_ICON_LINUX_WRAPPER_H_ |
OLD | NEW |