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 UI_LINUX_UI_STATUS_ICON_LINUX_H_ | 5 #ifndef UI_VIEWS_LINUX_UI_STATUS_ICON_LINUX_H_ |
6 #define UI_LINUX_UI_STATUS_ICON_LINUX_H_ | 6 #define UI_VIEWS_LINUX_UI_STATUS_ICON_LINUX_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "ui/linux_ui/linux_ui_export.h" | 9 #include "ui/views/views_export.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class ImageSkia; | 12 class ImageSkia; |
13 } | 13 } |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 class MenuModel; | 16 class MenuModel; |
17 } // namespace ui | 17 } // namespace ui |
18 | 18 |
| 19 namespace views { |
| 20 |
19 // Since liblinux_ui cannot have dependencies on any chrome browser components | 21 // Since liblinux_ui cannot have dependencies on any chrome browser components |
20 // we cannot inherit from StatusIcon. So we implement the necessary methods | 22 // we cannot inherit from StatusIcon. So we implement the necessary methods |
21 // and let a wrapper class implement the StatusIcon interface and defer the | 23 // and let a wrapper class implement the StatusIcon interface and defer the |
22 // callbacks to a delegate. For the same reason, do not use StatusIconMenuModel. | 24 // callbacks to a delegate. For the same reason, do not use StatusIconMenuModel. |
23 class LINUX_UI_EXPORT StatusIconLinux { | 25 class VIEWS_EXPORT StatusIconLinux { |
24 public: | 26 public: |
25 class Delegate { | 27 class Delegate { |
26 public: | 28 public: |
27 virtual void OnClick() = 0; | 29 virtual void OnClick() = 0; |
28 virtual bool HasClickAction() = 0; | 30 virtual bool HasClickAction() = 0; |
29 | 31 |
30 protected: | 32 protected: |
31 virtual ~Delegate(); | 33 virtual ~Delegate(); |
32 }; | 34 }; |
33 | 35 |
(...skipping 14 matching lines...) Expand all Loading... |
48 // need to manually refresh it when the menu model changes. | 50 // need to manually refresh it when the menu model changes. |
49 virtual void RefreshPlatformContextMenu(); | 51 virtual void RefreshPlatformContextMenu(); |
50 | 52 |
51 Delegate* delegate() { return delegate_; } | 53 Delegate* delegate() { return delegate_; } |
52 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 54 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
53 | 55 |
54 private: | 56 private: |
55 Delegate* delegate_; | 57 Delegate* delegate_; |
56 }; | 58 }; |
57 | 59 |
| 60 } // namespace views |
| 61 |
58 #endif // UI_LINUX_UI_STATUS_ICON_LINUX_H_ | 62 #endif // UI_LINUX_UI_STATUS_ICON_LINUX_H_ |
OLD | NEW |