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/chromeos/tray_display.h" | 5 #include "ash/system/chromeos/tray_display.h" |
6 | 6 |
7 #include "ash/common/system/chromeos/devicetype_utils.h" | 7 #include "ash/common/system/chromeos/devicetype_utils.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | |
10 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
12 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
13 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
14 #include "ash/test/display_manager_test_api.h" | 13 #include "ash/test/display_manager_test_api.h" |
15 #include "ash/test/test_system_tray_delegate.h" | 14 #include "ash/test/test_system_tray_delegate.h" |
16 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
17 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
18 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
19 #include "grit/ash_strings.h" | 18 #include "grit/ash_strings.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 CheckUpdate(); | 118 CheckUpdate(); |
120 return tray_; | 119 return tray_; |
121 } | 120 } |
122 | 121 |
123 TrayDisplay* TrayDisplayTest::GetTrayDisplay() { | 122 TrayDisplay* TrayDisplayTest::GetTrayDisplay() { |
124 CheckUpdate(); | 123 CheckUpdate(); |
125 return tray_display_; | 124 return tray_display_; |
126 } | 125 } |
127 | 126 |
128 void TrayDisplayTest::CheckUpdate() { | 127 void TrayDisplayTest::CheckUpdate() { |
129 SystemTray* current = | 128 SystemTray* current = GetPrimarySystemTray(); |
130 Shell::GetPrimaryRootWindowController()->GetSystemTray(); | |
131 if (tray_ != current) { | 129 if (tray_ != current) { |
132 tray_ = current; | 130 tray_ = current; |
133 tray_display_ = new TrayDisplay(tray_); | 131 tray_display_ = new TrayDisplay(tray_); |
134 tray_->AddTrayItem(tray_display_); | 132 tray_->AddTrayItem(tray_display_); |
135 } | 133 } |
136 } | 134 } |
137 | 135 |
138 void TrayDisplayTest::CloseNotification() { | 136 void TrayDisplayTest::CloseNotification() { |
139 message_center::MessageCenter::Get()->RemoveNotification( | 137 message_center::MessageCenter::Get()->RemoveNotification( |
140 TrayDisplay::kNotificationId, false); | 138 TrayDisplay::kNotificationId, false); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 display::Display::ROTATION_SOURCE_ACCELEROMETER); | 608 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
611 EXPECT_FALSE(IsDisplayVisibleInTray()); | 609 EXPECT_FALSE(IsDisplayVisibleInTray()); |
612 | 610 |
613 // If a non-rotation setting is changed, display regardless of the source of | 611 // If a non-rotation setting is changed, display regardless of the source of |
614 // rotation so that the full message is shown. | 612 // rotation so that the full message is shown. |
615 UpdateDisplay("400x400@1.5"); | 613 UpdateDisplay("400x400@1.5"); |
616 EXPECT_TRUE(IsDisplayVisibleInTray()); | 614 EXPECT_TRUE(IsDisplayVisibleInTray()); |
617 } | 615 } |
618 | 616 |
619 } // namespace ash | 617 } // namespace ash |
OLD | NEW |