| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ash/common/system/tray/system_tray.h" | 5 #include "ash/common/system/tray/system_tray.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 namespace ash { | 40 namespace ash { |
| 41 namespace test { | 41 namespace test { |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 // Trivial item implementation that tracks its views for testing. | 45 // Trivial item implementation that tracks its views for testing. |
| 46 class TestItem : public SystemTrayItem { | 46 class TestItem : public SystemTrayItem { |
| 47 public: | 47 public: |
| 48 TestItem() | 48 TestItem() |
| 49 : SystemTrayItem(AshTestBase::GetPrimarySystemTray()), | 49 : SystemTrayItem(AshTestBase::GetPrimarySystemTray(), NETWORK), |
| 50 tray_view_(nullptr), | 50 tray_view_(nullptr), |
| 51 default_view_(nullptr), | 51 default_view_(nullptr), |
| 52 detailed_view_(nullptr), | 52 detailed_view_(nullptr), |
| 53 notification_view_(nullptr) {} | 53 notification_view_(nullptr) {} |
| 54 | 54 |
| 55 views::View* CreateTrayView(LoginStatus status) override { | 55 views::View* CreateTrayView(LoginStatus status) override { |
| 56 tray_view_ = new views::View; | 56 tray_view_ = new views::View; |
| 57 // Add a label so it has non-zero width. | 57 // Add a label so it has non-zero width. |
| 58 tray_view_->SetLayoutManager(new views::FillLayout); | 58 tray_view_->SetLayoutManager(new views::FillLayout); |
| 59 tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray"))); | 59 tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray"))); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 views::View* tray_view_; | 99 views::View* tray_view_; |
| 100 views::View* default_view_; | 100 views::View* default_view_; |
| 101 views::View* detailed_view_; | 101 views::View* detailed_view_; |
| 102 views::View* notification_view_; | 102 views::View* notification_view_; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // Trivial item implementation that returns NULL from tray/default/detailed | 105 // Trivial item implementation that returns NULL from tray/default/detailed |
| 106 // view creation methods. | 106 // view creation methods. |
| 107 class TestNoViewItem : public SystemTrayItem { | 107 class TestNoViewItem : public SystemTrayItem { |
| 108 public: | 108 public: |
| 109 TestNoViewItem() : SystemTrayItem(AshTestBase::GetPrimarySystemTray()) {} | 109 TestNoViewItem() |
| 110 : SystemTrayItem(AshTestBase::GetPrimarySystemTray(), NETWORK) {} |
| 110 | 111 |
| 111 views::View* CreateTrayView(LoginStatus status) override { return nullptr; } | 112 views::View* CreateTrayView(LoginStatus status) override { return nullptr; } |
| 112 | 113 |
| 113 views::View* CreateDefaultView(LoginStatus status) override { | 114 views::View* CreateDefaultView(LoginStatus status) override { |
| 114 return nullptr; | 115 return nullptr; |
| 115 } | 116 } |
| 116 | 117 |
| 117 views::View* CreateDetailedView(LoginStatus status) override { | 118 views::View* CreateDetailedView(LoginStatus status) override { |
| 118 return nullptr; | 119 return nullptr; |
| 119 } | 120 } |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // Hide the default view, ensure the tray bubble height is back to zero. | 547 // Hide the default view, ensure the tray bubble height is back to zero. |
| 547 ASSERT_TRUE(tray->CloseSystemBubble()); | 548 ASSERT_TRUE(tray->CloseSystemBubble()); |
| 548 RunAllPendingInMessageLoop(); | 549 RunAllPendingInMessageLoop(); |
| 549 | 550 |
| 550 EXPECT_EQ(0, notification_tray->tray_bubble_height_for_test()); | 551 EXPECT_EQ(0, notification_tray->tray_bubble_height_for_test()); |
| 551 } | 552 } |
| 552 #endif // OS_CHROMEOS | 553 #endif // OS_CHROMEOS |
| 553 | 554 |
| 554 } // namespace test | 555 } // namespace test |
| 555 } // namespace ash | 556 } // namespace ash |
| OLD | NEW |