1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "ash/public/cpp/test/test_keyboard_controller_observer.h" 6 7 #include "base/run_loop.h" 8 9 namespace ash { 10 TestKeyboardControllerObserver(KeyboardController * controller)11TestKeyboardControllerObserver::TestKeyboardControllerObserver( 12 KeyboardController* controller) 13 : controller_(controller) { 14 controller_->AddObserver(this); 15 } 16 17 TestKeyboardControllerObserver::~TestKeyboardControllerObserver() = default; 18 OnKeyboardEnableFlagsChanged(const std::set<keyboard::KeyboardEnableFlag> & flags)19void TestKeyboardControllerObserver::OnKeyboardEnableFlagsChanged( 20 const std::set<keyboard::KeyboardEnableFlag>& flags) { 21 enable_flags_ = flags; 22 } 23 OnKeyboardEnabledChanged(bool enabled)24void TestKeyboardControllerObserver::OnKeyboardEnabledChanged(bool enabled) { 25 if (!enabled) 26 ++destroyed_count_; 27 } 28 OnKeyboardConfigChanged(const keyboard::KeyboardConfig & config)29void TestKeyboardControllerObserver::OnKeyboardConfigChanged( 30 const keyboard::KeyboardConfig& config) { 31 config_ = config; 32 } 33 OnKeyboardVisibilityChanged(bool visible)34void TestKeyboardControllerObserver::OnKeyboardVisibilityChanged(bool visible) { 35 } 36 OnKeyboardVisibleBoundsChanged(const gfx::Rect & bounds)37void TestKeyboardControllerObserver::OnKeyboardVisibleBoundsChanged( 38 const gfx::Rect& bounds) {} 39 OnKeyboardOccludedBoundsChanged(const gfx::Rect & bounds)40void TestKeyboardControllerObserver::OnKeyboardOccludedBoundsChanged( 41 const gfx::Rect& bounds) {} 42 OnKeyboardUIDestroyed()43void TestKeyboardControllerObserver::OnKeyboardUIDestroyed() {} 44 45 } // namespace ash 46