blob: b43fc2e7f30e1ff8d3804a164d13298e70a1d8f7 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/ash_export.h"
#include "ash/shell_observer.h"
#include "ash/system/tray/system_tray_notifier.h"
#include "base/macros.h"
#include "ui/events/devices/input_device_event_observer.h"
namespace ash {
// This class observes input device changes for the virtual keyboard.
class ASH_EXPORT VirtualKeyboardController
: public ShellObserver,
public ui::InputDeviceEventObserver {
~VirtualKeyboardController() override;
// ShellObserver:
// TODO(rsadam@): Remove when autovirtual keyboard flag is on by default.
void OnMaximizeModeStarted() override;
void OnMaximizeModeEnded() override;
// ui::InputDeviceObserver:
void OnTouchscreenDeviceConfigurationChanged() override;
void OnKeyboardDeviceConfigurationChanged() override;
// Toggles whether the presense of an external keyboard should be ignored
// when determining whether or not to show the on-screen keyboard.
void ToggleIgnoreExternalKeyboard();
// Updates the list of active input devices.
void UpdateDevices();
// Updates the keyboard state.
void UpdateKeyboardEnabled();
// Creates the keyboard if |enabled|, else destroys it.
void SetKeyboardEnabled(bool enabled);
// True if an external keyboard is connected.
bool has_external_keyboard_;
// True if an internal keyboard is connected.
bool has_internal_keyboard_;
// True if a touchscreen is connected.
bool has_touchscreen_;
// True if the presense of an external keyboard should be ignored.
bool ignore_external_keyboard_;
} // namespace ash