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 #include "ash/system/tray/tray_details_view.h" | 5 #include "ash/system/tray/tray_details_view.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shelf/shelf_widget.h" | 8 #include "ash/shelf/shelf_widget.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {} | 57 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {} |
58 | 58 |
59 // Overridden from SystemTrayItem: | 59 // Overridden from SystemTrayItem: |
60 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE { | 60 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE { |
61 tray_view_ = new views::View; | 61 tray_view_ = new views::View; |
62 return tray_view_; | 62 return tray_view_; |
63 } | 63 } |
64 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { | 64 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE { |
65 default_view_ = new views::View; | 65 default_view_ = new views::View; |
66 default_view_->set_focusable(true); | 66 default_view_->SetFocusable(true); |
67 return default_view_; | 67 return default_view_; |
68 } | 68 } |
69 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE { | 69 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE { |
70 detailed_view_ = new TestDetailsView(this); | 70 detailed_view_ = new TestDetailsView(this); |
71 return detailed_view_; | 71 return detailed_view_; |
72 } | 72 } |
73 virtual void DestroyTrayView() OVERRIDE { | 73 virtual void DestroyTrayView() OVERRIDE { |
74 tray_view_ = NULL; | 74 tray_view_ = NULL; |
75 } | 75 } |
76 virtual void DestroyDefaultView() OVERRIDE { | 76 virtual void DestroyDefaultView() OVERRIDE { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 test_item_2->detailed_view()->TransitionToDefaultView(); | 140 test_item_2->detailed_view()->TransitionToDefaultView(); |
141 RunAllPendingInMessageLoop(); | 141 RunAllPendingInMessageLoop(); |
142 | 142 |
143 EXPECT_TRUE(test_item_2->default_view()); | 143 EXPECT_TRUE(test_item_2->default_view()); |
144 EXPECT_FALSE(test_item_2->detailed_view()); | 144 EXPECT_FALSE(test_item_2->detailed_view()); |
145 EXPECT_FALSE(test_item_2->default_view()->HasFocus()); | 145 EXPECT_FALSE(test_item_2->default_view()->HasFocus()); |
146 } | 146 } |
147 | 147 |
148 } // namespace test | 148 } // namespace test |
149 } // namespace ash | 149 } // namespace ash |
OLD | NEW |