OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ime/tray_ime_chromeos.h" | 5 #include "ash/system/ime/tray_ime_chromeos.h" |
6 | 6 |
7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/common/system/tray/wm_system_tray_notifier.h" |
| 9 #include "ash/common/wm_shell.h" |
9 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
10 #include "ash/system/tray/system_tray_notifier.h" | 11 #include "ash/system/tray/tray_details_view.h" |
11 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
12 #include "ash/test/status_area_widget_test_helper.h" | 13 #include "ash/test/status_area_widget_test_helper.h" |
13 #include "ash/test/virtual_keyboard_test_helper.h" | 14 #include "ash/test/virtual_keyboard_test_helper.h" |
14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
15 #include "ui/keyboard/keyboard_util.h" | 16 #include "ui/keyboard/keyboard_util.h" |
16 | 17 |
17 namespace ash { | 18 namespace ash { |
18 | 19 |
19 class TrayIMETest : public test::AshTestBase { | 20 class TrayIMETest : public test::AshTestBase { |
20 public: | 21 public: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void TrayIMETest::SetUpForStatusAreaWidget( | 60 void TrayIMETest::SetUpForStatusAreaWidget( |
60 StatusAreaWidget* status_area_widget) { | 61 StatusAreaWidget* status_area_widget) { |
61 tray_.reset(new TrayIME(status_area_widget->system_tray())); | 62 tray_.reset(new TrayIME(status_area_widget->system_tray())); |
62 default_view_.reset(tray_->CreateDefaultView( | 63 default_view_.reset(tray_->CreateDefaultView( |
63 StatusAreaWidgetTestHelper::GetUserLoginStatus())); | 64 StatusAreaWidgetTestHelper::GetUserLoginStatus())); |
64 detailed_view_.reset(tray_->CreateDetailedView( | 65 detailed_view_.reset(tray_->CreateDetailedView( |
65 StatusAreaWidgetTestHelper::GetUserLoginStatus())); | 66 StatusAreaWidgetTestHelper::GetUserLoginStatus())); |
66 } | 67 } |
67 | 68 |
68 void TrayIMETest::SetAccessibilityKeyboardEnabled(bool enabled) { | 69 void TrayIMETest::SetAccessibilityKeyboardEnabled(bool enabled) { |
69 Shell::GetInstance()->accessibility_delegate()->SetVirtualKeyboardEnabled( | 70 WmShell::Get()->GetAccessibilityDelegate()->SetVirtualKeyboardEnabled( |
70 enabled); | 71 enabled); |
71 keyboard::SetAccessibilityKeyboardEnabled(enabled); | 72 keyboard::SetAccessibilityKeyboardEnabled(enabled); |
72 ui::AccessibilityNotificationVisibility notification = | 73 ui::AccessibilityNotificationVisibility notification = |
73 enabled ? ui::AccessibilityNotificationVisibility::A11Y_NOTIFICATION_SHOW | 74 enabled ? ui::AccessibilityNotificationVisibility::A11Y_NOTIFICATION_SHOW |
74 : ui::AccessibilityNotificationVisibility::A11Y_NOTIFICATION_NONE; | 75 : ui::AccessibilityNotificationVisibility::A11Y_NOTIFICATION_NONE; |
75 Shell::GetInstance()->system_tray_notifier()->NotifyAccessibilityModeChanged( | 76 WmShell::Get()->system_tray_notifier()->NotifyAccessibilityModeChanged( |
76 notification); | 77 notification); |
77 } | 78 } |
78 | 79 |
79 void TrayIMETest::TearDownViews() { | 80 void TrayIMETest::TearDownViews() { |
80 tray_.reset(); | 81 tray_.reset(); |
81 default_view_.reset(); | 82 default_view_.reset(); |
82 detailed_view_.reset(); | 83 detailed_view_.reset(); |
83 } | 84 } |
84 | 85 |
85 void TrayIMETest::SetIMELength(int length) { | 86 void TrayIMETest::SetIMELength(int length) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 toggle = GetScrollChildView(0); | 153 toggle = GetScrollChildView(0); |
153 // Clicking again should disable the keyboard. | 154 // Clicking again should disable the keyboard. |
154 tap = ui::GestureEvent(0, 0, 0, base::TimeTicks(), | 155 tap = ui::GestureEvent(0, 0, 0, base::TimeTicks(), |
155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 156 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
156 toggle->OnGestureEvent(&tap); | 157 toggle->OnGestureEvent(&tap); |
157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 158 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
158 EXPECT_TRUE(default_view()->visible()); | 159 EXPECT_TRUE(default_view()->visible()); |
159 } | 160 } |
160 | 161 |
161 } // namespace ash | 162 } // namespace ash |
OLD | NEW |