| 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/screen_layout_observer.h" | 5 #include "ash/system/screen_layout_observer.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/strings/grit/ash_strings.h" | 8 #include "ash/strings/grit/ash_strings.h" |
| 9 #include "ash/system/devicetype_utils.h" | 9 #include "ash/system/devicetype_utils.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/test/test_system_tray_delegate.h" | 12 #include "ash/test/test_system_tray_delegate.h" |
| 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "ui/accessibility/ax_node_data.h" | 17 #include "ui/accessibility/ax_node_data.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/display/display.h" | 19 #include "ui/display/display.h" |
| 19 #include "ui/display/display_layout_builder.h" | 20 #include "ui/display/display_layout_builder.h" |
| 20 #include "ui/display/manager/display_manager.h" | 21 #include "ui/display/manager/display_manager.h" |
| 21 #include "ui/message_center/message_center.h" | 22 #include "ui/message_center/message_center.h" |
| 22 #include "ui/message_center/notification.h" | 23 #include "ui/message_center/notification.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 449 |
| 449 // The user source. | 450 // The user source. |
| 450 display_manager()->SetDisplayRotation(primary_id, | 451 display_manager()->SetDisplayRotation(primary_id, |
| 451 display::Display::ROTATE_180, | 452 display::Display::ROTATE_180, |
| 452 display::Display::ROTATION_SOURCE_USER); | 453 display::Display::ROTATION_SOURCE_USER); |
| 453 EXPECT_EQ(l10n_util::GetStringFUTF16( | 454 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 454 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), | 455 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
| 455 l10n_util::GetStringUTF16( | 456 l10n_util::GetStringUTF16( |
| 456 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)), | 457 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)), |
| 457 GetDisplayNotificationAdditionalText()); | 458 GetDisplayNotificationAdditionalText()); |
| 459 |
| 460 // The active source. |
| 461 display_manager()->SetDisplayRotation( |
| 462 primary_id, display::Display::ROTATE_270, |
| 463 display::Display::ROTATION_SOURCE_ACTIVE); |
| 464 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 465 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
| 466 l10n_util::GetStringUTF16( |
| 467 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270)), |
| 468 GetDisplayNotificationAdditionalText()); |
| 469 |
| 470 // Switch to Tablet |
| 471 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 472 true); |
| 473 |
| 474 // The accelerometer source. |
| 475 display_manager()->SetDisplayRotation( |
| 476 primary_id, display::Display::ROTATE_90, |
| 477 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
| 478 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 479 |
| 480 // The user source. |
| 481 display_manager()->SetDisplayRotation(primary_id, |
| 482 display::Display::ROTATE_180, |
| 483 display::Display::ROTATION_SOURCE_USER); |
| 484 EXPECT_EQ(l10n_util::GetStringFUTF16( |
| 485 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
| 486 l10n_util::GetStringUTF16( |
| 487 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)), |
| 488 GetDisplayNotificationAdditionalText()); |
| 489 |
| 490 // The active source. |
| 491 display_manager()->SetDisplayRotation( |
| 492 primary_id, display::Display::ROTATE_270, |
| 493 display::Display::ROTATION_SOURCE_ACTIVE); |
| 458 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 494 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
| 459 } | 495 } |
| 460 | 496 |
| 461 } // namespace ash | 497 } // namespace ash |
| OLD | NEW |