| 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/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/status_area_widget.h" | 9 #include "ash/system/status_area_widget.h" |
| 10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Returns the view in the detailed views scroll content at the provided | 45 // Returns the view in the detailed views scroll content at the provided |
| 46 // index. | 46 // index. |
| 47 views::View* GetScrollChildView(int index); | 47 views::View* GetScrollChildView(int index); |
| 48 | 48 |
| 49 // test::AshTestBase: | 49 // test::AshTestBase: |
| 50 void SetUp() override; | 50 void SetUp() override; |
| 51 void TearDown() override; | 51 void TearDown() override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 scoped_ptr<TrayIME> tray_; | 54 std::unique_ptr<TrayIME> tray_; |
| 55 scoped_ptr<views::View> default_view_; | 55 std::unique_ptr<views::View> default_view_; |
| 56 scoped_ptr<views::View> detailed_view_; | 56 std::unique_ptr<views::View> detailed_view_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 void TrayIMETest::SetUpForStatusAreaWidget( | 59 void TrayIMETest::SetUpForStatusAreaWidget( |
| 60 StatusAreaWidget* status_area_widget) { | 60 StatusAreaWidget* status_area_widget) { |
| 61 tray_.reset(new TrayIME(status_area_widget->system_tray())); | 61 tray_.reset(new TrayIME(status_area_widget->system_tray())); |
| 62 default_view_.reset(tray_->CreateDefaultView( | 62 default_view_.reset(tray_->CreateDefaultView( |
| 63 StatusAreaWidgetTestHelper::GetUserLoginStatus())); | 63 StatusAreaWidgetTestHelper::GetUserLoginStatus())); |
| 64 detailed_view_.reset(tray_->CreateDetailedView( | 64 detailed_view_.reset(tray_->CreateDetailedView( |
| 65 StatusAreaWidgetTestHelper::GetUserLoginStatus())); | 65 StatusAreaWidgetTestHelper::GetUserLoginStatus())); |
| 66 } | 66 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 toggle = GetScrollChildView(0); | 152 toggle = GetScrollChildView(0); |
| 153 // Clicking again should disable the keyboard. | 153 // Clicking again should disable the keyboard. |
| 154 tap = ui::GestureEvent(0, 0, 0, base::TimeDelta(), | 154 tap = ui::GestureEvent(0, 0, 0, base::TimeDelta(), |
| 155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 155 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 156 toggle->OnGestureEvent(&tap); | 156 toggle->OnGestureEvent(&tap); |
| 157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); | 157 EXPECT_FALSE(keyboard::IsKeyboardEnabled()); |
| 158 EXPECT_TRUE(default_view()->visible()); | 158 EXPECT_TRUE(default_view()->visible()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |