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

Unified Diff: ash/test/test_system_tray_item.h

Issue 2162153002: Added Ash.SystemMenu.DefaultView.VisibleItems histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary includes after self review. Created 4 years, 5 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
Index: ash/test/test_system_tray_item.h
diff --git a/ash/test/test_system_tray_item.h b/ash/test/test_system_tray_item.h
new file mode 100644
index 0000000000000000000000000000000000000000..51a568be9dca7ef6bfbf8d83796c7a5e0cc7e895
--- /dev/null
+++ b/ash/test/test_system_tray_item.h
@@ -0,0 +1,51 @@
+// Copyright 2016 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_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_
+#define ASH_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_
+
+#include "ash/common/system/tray/system_tray_item.h"
+
+namespace ash {
+namespace test {
+
+// Trivial item implementation that tracks its views for testing.
+class TestSystemTrayItem : public SystemTrayItem {
+ public:
+ explicit TestSystemTrayItem(bool has_views);
James Cook 2016/07/20 20:13:50 nit: Don't pass |has_views| in the constructor. Ma
bruthig 2016/07/21 14:34:58 Done.
+
James Cook 2016/07/20 20:13:49 ~TestSystemTrayItem() override
bruthig 2016/07/21 14:34:58 Done.
+ void set_has_views(bool has_views) { has_views_ = has_views; }
+ void set_views_are_visible(bool visible) { views_are_visible_ = visible; }
+
+ views::View* tray_view() const { return tray_view_; }
+ views::View* default_view() const { return default_view_; }
+ views::View* detailed_view() const { return detailed_view_; }
+ views::View* notification_view() const { return notification_view_; }
+
+ // SystemTrayItem:
+ views::View* CreateTrayView(LoginStatus status) override;
+ views::View* CreateDefaultView(LoginStatus status) override;
+ views::View* CreateDetailedView(LoginStatus status) override;
+ views::View* CreateNotificationView(LoginStatus status) override;
+ void DestroyTrayView() override;
+ void DestroyDefaultView() override;
+ void DestroyDetailedView() override;
+ void DestroyNotificationView() override;
+ void UpdateAfterLoginStatusChange(LoginStatus status) override;
+
+ private:
+ bool has_views_;
+ bool views_are_visible_;
+ views::View* tray_view_;
+ views::View* default_view_;
+ views::View* detailed_view_;
+ views::View* notification_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestSystemTrayItem);
+};
+
+} // namespace test
+} // namespace ash
+
+#endif // ASH_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698