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 "ash/wm/tablet_mode/tablet_mode_controller.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "ui/accessibility/ax_node_data.h" | 17 #include "ui/accessibility/ax_node_data.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/display/display.h" | 19 #include "ui/display/display.h" |
20 #include "ui/display/display_layout_builder.h" | 20 #include "ui/display/display_layout_builder.h" |
21 #include "ui/display/manager/display_manager.h" | 21 #include "ui/display/manager/display_manager.h" |
22 #include "ui/message_center/message_center.h" | 22 #include "ui/message_center/message_center.h" |
23 #include "ui/message_center/notification.h" | 23 #include "ui/message_center/notification.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 display_manager()->SetDisplayRotation( | 461 display_manager()->SetDisplayRotation( |
462 primary_id, display::Display::ROTATE_270, | 462 primary_id, display::Display::ROTATE_270, |
463 display::Display::ROTATION_SOURCE_ACTIVE); | 463 display::Display::ROTATION_SOURCE_ACTIVE); |
464 EXPECT_EQ(l10n_util::GetStringFUTF16( | 464 EXPECT_EQ(l10n_util::GetStringFUTF16( |
465 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), | 465 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
466 l10n_util::GetStringUTF16( | 466 l10n_util::GetStringUTF16( |
467 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270)), | 467 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270)), |
468 GetDisplayNotificationAdditionalText()); | 468 GetDisplayNotificationAdditionalText()); |
469 | 469 |
470 // Switch to Tablet | 470 // Switch to Tablet |
471 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 471 Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); |
472 true); | |
473 | 472 |
474 // The accelerometer source. | 473 // The accelerometer source. |
475 display_manager()->SetDisplayRotation( | 474 display_manager()->SetDisplayRotation( |
476 primary_id, display::Display::ROTATE_90, | 475 primary_id, display::Display::ROTATE_90, |
477 display::Display::ROTATION_SOURCE_ACCELEROMETER); | 476 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
478 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 477 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
479 | 478 |
480 // The user source. | 479 // The user source. |
481 display_manager()->SetDisplayRotation(primary_id, | 480 display_manager()->SetDisplayRotation(primary_id, |
482 display::Display::ROTATE_180, | 481 display::Display::ROTATE_180, |
483 display::Display::ROTATION_SOURCE_USER); | 482 display::Display::ROTATION_SOURCE_USER); |
484 EXPECT_EQ(l10n_util::GetStringFUTF16( | 483 EXPECT_EQ(l10n_util::GetStringFUTF16( |
485 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), | 484 IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetFirstDisplayName(), |
486 l10n_util::GetStringUTF16( | 485 l10n_util::GetStringUTF16( |
487 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)), | 486 IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180)), |
488 GetDisplayNotificationAdditionalText()); | 487 GetDisplayNotificationAdditionalText()); |
489 | 488 |
490 // The active source. | 489 // The active source. |
491 display_manager()->SetDisplayRotation( | 490 display_manager()->SetDisplayRotation( |
492 primary_id, display::Display::ROTATE_270, | 491 primary_id, display::Display::ROTATE_270, |
493 display::Display::ROTATION_SOURCE_ACTIVE); | 492 display::Display::ROTATION_SOURCE_ACTIVE); |
494 EXPECT_TRUE(GetDisplayNotificationText().empty()); | 493 EXPECT_TRUE(GetDisplayNotificationText().empty()); |
495 } | 494 } |
496 | 495 |
497 } // namespace ash | 496 } // namespace ash |
OLD | NEW |