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/wm/ash_activation_controller.h" | 5 #include "ash/wm/ash_activation_controller.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_widget.h" |
9 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
10 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
11 #include "ash/wm/property_util.h" | 12 #include "ash/wm/property_util.h" |
12 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
13 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
14 #include "ui/views/corewm/corewm_switches.h" | 15 #include "ui/views/corewm/corewm_switches.h" |
15 | 16 |
16 namespace ash { | 17 namespace ash { |
17 | 18 |
18 namespace wm { | 19 namespace wm { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 class AshActivationControllerTest : public test::AshTestBase { | 23 class AshActivationControllerTest : public test::AshTestBase { |
23 public: | 24 public: |
24 AshActivationControllerTest() | 25 AshActivationControllerTest() |
25 : launcher_(NULL), launcher_widget_(NULL), launcher_window_(NULL) {} | 26 : launcher_(NULL), launcher_widget_(NULL), launcher_window_(NULL) {} |
26 virtual ~AshActivationControllerTest() {} | 27 virtual ~AshActivationControllerTest() {} |
27 | 28 |
28 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
29 test::AshTestBase::SetUp(); | 30 test::AshTestBase::SetUp(); |
30 ash_activation_controller_.reset(new internal::AshActivationController()); | 31 ash_activation_controller_.reset(new internal::AshActivationController()); |
31 launcher_ = Launcher::ForPrimaryDisplay(); | 32 launcher_ = Launcher::ForPrimaryDisplay(); |
32 ASSERT_TRUE(launcher_); | 33 ASSERT_TRUE(launcher_); |
33 launcher_widget_ = launcher_->widget(); | 34 launcher_widget_ = launcher_->shelf_widget(); |
34 ASSERT_TRUE(launcher_widget_); | 35 ASSERT_TRUE(launcher_widget_); |
35 launcher_window_ = launcher_widget_->GetNativeWindow(); | 36 launcher_window_ = launcher_widget_->GetNativeWindow(); |
36 ASSERT_TRUE(launcher_window_); | 37 ASSERT_TRUE(launcher_window_); |
37 } | 38 } |
38 | 39 |
39 void SetSpokenFeedbackState(bool enabled) { | 40 void SetSpokenFeedbackState(bool enabled) { |
40 if (Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled() != | 41 if (Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled() != |
41 enabled) { | 42 enabled) { |
42 Shell::GetInstance()->delegate()->ToggleSpokenFeedback( | 43 Shell::GetInstance()->delegate()->ToggleSpokenFeedback( |
43 A11Y_NOTIFICATION_NONE); | 44 A11Y_NOTIFICATION_NONE); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 159 |
159 // Verify if the launcher didn't get activated as fallback. | 160 // Verify if the launcher didn't get activated as fallback. |
160 ASSERT_NE(launcher_window_, GetActiveWindow()); | 161 ASSERT_NE(launcher_window_, GetActiveWindow()); |
161 } | 162 } |
162 | 163 |
163 } // namespace | 164 } // namespace |
164 | 165 |
165 } // namespace wm | 166 } // namespace wm |
166 | 167 |
167 } // namespace ash | 168 } // namespace ash |
OLD | NEW |