| 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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 #include "ash/accelerators/accelerator_table.h" | 6 #include "ash/accelerators/accelerator_table.h" |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/ime_control_delegate.h" | 10 #include "ash/ime_control_delegate.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 EXPECT_NEAR(bounds.x() - work_area.x(), | 539 EXPECT_NEAR(bounds.x() - work_area.x(), |
| 540 work_area.right() - bounds.right(), | 540 work_area.right() - bounds.right(), |
| 541 1); | 541 1); |
| 542 EXPECT_NEAR(bounds.y() - work_area.y(), | 542 EXPECT_NEAR(bounds.y() - work_area.y(), |
| 543 work_area.bottom() - bounds.bottom(), | 543 work_area.bottom() - bounds.bottom(), |
| 544 1); | 544 1); |
| 545 | 545 |
| 546 // Add the window to docked container and try to center it. | 546 // Add the window to docked container and try to center it. |
| 547 window->SetBounds(gfx::Rect(0, 0, 20, 20)); | 547 window->SetBounds(gfx::Rect(0, 0, 20, 20)); |
| 548 aura::Window* docked_container = Shell::GetContainer( | 548 aura::Window* docked_container = Shell::GetContainer( |
| 549 window->GetRootWindow(), internal::kShellWindowId_DockedContainer); | 549 window->GetRootWindow(), kShellWindowId_DockedContainer); |
| 550 docked_container->AddChild(window.get()); | 550 docked_container->AddChild(window.get()); |
| 551 gfx::Rect docked_bounds = window->GetBoundsInScreen(); | 551 gfx::Rect docked_bounds = window->GetBoundsInScreen(); |
| 552 GetController()->PerformAction(WINDOW_POSITION_CENTER, dummy); | 552 GetController()->PerformAction(WINDOW_POSITION_CENTER, dummy); |
| 553 // It should not get centered and should remain docked. | 553 // It should not get centered and should remain docked. |
| 554 EXPECT_EQ(internal::kShellWindowId_DockedContainer, window->parent()->id()); | 554 EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id()); |
| 555 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 555 EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| 556 } | 556 } |
| 557 | 557 |
| 558 TEST_F(AcceleratorControllerTest, ControllerContext) { | 558 TEST_F(AcceleratorControllerTest, ControllerContext) { |
| 559 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); | 559 ui::Accelerator accelerator_a(ui::VKEY_A, ui::EF_NONE); |
| 560 ui::Accelerator accelerator_a2(ui::VKEY_A, ui::EF_NONE); | 560 ui::Accelerator accelerator_a2(ui::VKEY_A, ui::EF_NONE); |
| 561 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_NONE); | 561 ui::Accelerator accelerator_b(ui::VKEY_B, ui::EF_NONE); |
| 562 | 562 |
| 563 accelerator_a.set_type(ui::ET_KEY_PRESSED); | 563 accelerator_a.set_type(ui::ET_KEY_PRESSED); |
| 564 accelerator_a2.set_type(ui::ET_KEY_RELEASED); | 564 accelerator_a2.set_type(ui::ET_KEY_RELEASED); |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 // Don't alert if we have a minimized window either. | 1252 // Don't alert if we have a minimized window either. |
| 1253 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 1253 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
| 1254 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { | 1254 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { |
| 1255 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); | 1255 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); |
| 1256 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); | 1256 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); |
| 1257 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); | 1257 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); |
| 1258 } | 1258 } |
| 1259 } | 1259 } |
| 1260 | 1260 |
| 1261 } // namespace ash | 1261 } // namespace ash |
| OLD | NEW |