Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: ash/system/chromeos/tray_tracing.h

Issue 22654003: Create system tray item for accessing chrome://slow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix non-chromeos build Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/resources/ash_resources.grd ('k') | ash/system/chromeos/tray_tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/tray_tracing.h
diff --git a/ash/system/chromeos/tray_tracing.h b/ash/system/chromeos/tray_tracing.h
new file mode 100644
index 0000000000000000000000000000000000000000..f9491e1d90319dd1595a15eba32f8527545d94ff
--- /dev/null
+++ b/ash/system/chromeos/tray_tracing.h
@@ -0,0 +1,57 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_SYSTEM_TRAY_TRACING_H_
+#define ASH_SYSTEM_TRAY_TRACING_H_
+
+#include "ash/ash_export.h"
+#include "ash/system/tray/tray_image_item.h"
+
+namespace views {
+class View;
+}
+
+namespace ash {
+
+class ASH_EXPORT TracingObserver {
+ public:
+ virtual ~TracingObserver() {}
+
+ // Notifies when tracing mode changes.
+ virtual void OnTracingModeChanged(bool value) = 0;
+};
+
+namespace internal {
+
+// This is the item that displays when users enable performance tracing at
+// chrome://slow. It alerts them that this mode is running, and provides an
+// easy way to open the page to disable it.
+class TrayTracing : public TrayImageItem,
+ public TracingObserver {
+ public:
+ explicit TrayTracing(SystemTray* system_tray);
+ virtual ~TrayTracing();
+
+ private:
+ void SetTrayIconVisible(bool visible);
+
+ // Overridden from TrayImageItem.
+ virtual bool GetInitialVisibility() OVERRIDE;
+ virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
+ virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
+ virtual void DestroyDefaultView() OVERRIDE;
+ virtual void DestroyDetailedView() OVERRIDE;
+
+ // Overridden from TracingObserver.
+ virtual void OnTracingModeChanged(bool value) OVERRIDE;
+
+ views::View* default_;
+
+ DISALLOW_COPY_AND_ASSIGN(TrayTracing);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_SYSTEM_TRAY_TRACING_H_
« no previous file with comments | « ash/resources/ash_resources.grd ('k') | ash/system/chromeos/tray_tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698