OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_ |
| 7 |
| 8 #include "ash/common/system/tray/system_tray_item.h" |
| 9 |
| 10 namespace ash { |
| 11 namespace test { |
| 12 |
| 13 // Trivial item implementation that tracks its views for testing. By default |
| 14 // views are created and returned by the Create*View() methods and they are |
| 15 // configured to be visible. Use set_has_views() and set_views_are_visible() to |
| 16 // change this behavior. |
| 17 class TestSystemTrayItem : public SystemTrayItem { |
| 18 public: |
| 19 TestSystemTrayItem(); |
| 20 explicit TestSystemTrayItem(SystemTrayItem::UmaType uma_type); |
| 21 ~TestSystemTrayItem() override; |
| 22 |
| 23 void set_has_views(bool has_views) { has_views_ = has_views; } |
| 24 void set_views_are_visible(bool visible) { views_are_visible_ = visible; } |
| 25 |
| 26 views::View* tray_view() const { return tray_view_; } |
| 27 views::View* default_view() const { return default_view_; } |
| 28 views::View* detailed_view() const { return detailed_view_; } |
| 29 views::View* notification_view() const { return notification_view_; } |
| 30 |
| 31 // SystemTrayItem: |
| 32 views::View* CreateTrayView(LoginStatus status) override; |
| 33 views::View* CreateDefaultView(LoginStatus status) override; |
| 34 views::View* CreateDetailedView(LoginStatus status) override; |
| 35 views::View* CreateNotificationView(LoginStatus status) override; |
| 36 void DestroyTrayView() override; |
| 37 void DestroyDefaultView() override; |
| 38 void DestroyDetailedView() override; |
| 39 void DestroyNotificationView() override; |
| 40 void UpdateAfterLoginStatusChange(LoginStatus status) override; |
| 41 |
| 42 private: |
| 43 bool has_views_; |
| 44 bool views_are_visible_; |
| 45 views::View* tray_view_; |
| 46 views::View* default_view_; |
| 47 views::View* detailed_view_; |
| 48 views::View* notification_view_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayItem); |
| 51 }; |
| 52 |
| 53 } // namespace test |
| 54 } // namespace ash |
| 55 |
| 56 #endif // ASH_COMMON_SYSTEM_TRAY_TEST_TEST_SYSTEM_TRAY_ITEM_H_ |
OLD | NEW |