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 ASH_SYSTEM_TRAY_TRACING_H_ | 5 #ifndef ASH_SYSTEM_TRAY_TRACING_H_ |
6 #define ASH_SYSTEM_TRAY_TRACING_H_ | 6 #define ASH_SYSTEM_TRAY_TRACING_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/tray/tray_image_item.h" | 9 #include "ash/system/tray/tray_image_item.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 class View; | 12 class View; |
13 } | 13 } |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 | 16 |
17 class ASH_EXPORT TracingObserver { | 17 class ASH_EXPORT TracingObserver { |
18 public: | 18 public: |
19 virtual ~TracingObserver() {} | 19 virtual ~TracingObserver() {} |
20 | 20 |
21 // Notifies when tracing mode changes. | 21 // Notifies when tracing mode changes. |
22 virtual void OnTracingModeChanged(bool value) = 0; | 22 virtual void OnTracingModeChanged(bool value) = 0; |
23 }; | 23 }; |
24 | 24 |
25 namespace internal { | |
26 | |
27 // This is the item that displays when users enable performance tracing at | 25 // This is the item that displays when users enable performance tracing at |
28 // chrome://slow. It alerts them that this mode is running, and provides an | 26 // chrome://slow. It alerts them that this mode is running, and provides an |
29 // easy way to open the page to disable it. | 27 // easy way to open the page to disable it. |
30 class TrayTracing : public TrayImageItem, | 28 class TrayTracing : public TrayImageItem, |
31 public TracingObserver { | 29 public TracingObserver { |
32 public: | 30 public: |
33 explicit TrayTracing(SystemTray* system_tray); | 31 explicit TrayTracing(SystemTray* system_tray); |
34 virtual ~TrayTracing(); | 32 virtual ~TrayTracing(); |
35 | 33 |
36 private: | 34 private: |
37 void SetTrayIconVisible(bool visible); | 35 void SetTrayIconVisible(bool visible); |
38 | 36 |
39 // Overridden from TrayImageItem. | 37 // Overridden from TrayImageItem. |
40 virtual bool GetInitialVisibility() OVERRIDE; | 38 virtual bool GetInitialVisibility() OVERRIDE; |
41 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 39 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
42 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 40 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
43 virtual void DestroyDefaultView() OVERRIDE; | 41 virtual void DestroyDefaultView() OVERRIDE; |
44 virtual void DestroyDetailedView() OVERRIDE; | 42 virtual void DestroyDetailedView() OVERRIDE; |
45 | 43 |
46 // Overridden from TracingObserver. | 44 // Overridden from TracingObserver. |
47 virtual void OnTracingModeChanged(bool value) OVERRIDE; | 45 virtual void OnTracingModeChanged(bool value) OVERRIDE; |
48 | 46 |
49 views::View* default_; | 47 views::View* default_; |
50 | 48 |
51 DISALLOW_COPY_AND_ASSIGN(TrayTracing); | 49 DISALLOW_COPY_AND_ASSIGN(TrayTracing); |
52 }; | 50 }; |
53 | 51 |
54 } // namespace internal | |
55 } // namespace ash | 52 } // namespace ash |
56 | 53 |
57 #endif // ASH_SYSTEM_TRAY_TRACING_H_ | 54 #endif // ASH_SYSTEM_TRAY_TRACING_H_ |
OLD | NEW |