Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3083)

Unified Diff: chrome/browser/chromeos/login/ui/webui_login_view.h

Issue 2814863002: cros: Allow JS to control virtual keyboard on sign-in screen. (Closed)
Patch Set: Initial upload Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/ui/webui_login_view.h
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.h b/chrome/browser/chromeos/login/ui/webui_login_view.h
index 59006f9bbbf8d48a35c76fd5bed5481dacd4ae7b..ba6602e10210e6540864ee60c797be78eb310c65 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.h
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.h
@@ -8,6 +8,7 @@
#include <map>
#include <string>
+#include "ash/shell_observer.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
@@ -16,6 +17,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "ui/keyboard/keyboard_controller_observer.h"
#include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -38,6 +40,8 @@ class OobeUI;
// View used to render a WebUI supporting Widget. This widget is used for the
// WebUI based start up and lock screens. It contains a WebView.
class WebUILoginView : public views::View,
+ public ash::ShellObserver,
+ public keyboard::KeyboardControllerObserver,
public content::WebContentsDelegate,
public content::NotificationObserver,
public ChromeWebModalDialogManagerDelegate,
@@ -135,6 +139,14 @@ class WebUILoginView : public views::View,
// Map type for the accelerator-to-identifier map.
typedef std::map<ui::Accelerator, std::string> AccelMap;
+ // ash::ShellObserver:
+ void OnVirtualKeyboardStateChanged(bool activated,
+ ash::WmWindow* root_window) override;
+
+ // keyboard::KeyboardControllerObserver:
+ void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override;
+ void OnKeyboardClosed() override;
+
// Overridden from content::WebContentsDelegate.
bool HandleContextMenu(const content::ContextMenuParams& params) override;
void HandleKeyboardEvent(
@@ -188,6 +200,9 @@ class WebUILoginView : public views::View,
// True to forward keyboard event.
bool forward_keyboard_event_ = true;
+ // True iff this object is observing a keyboard controller.
+ bool is_observing_keyboard_ = false;
+
base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_;
DISALLOW_COPY_AND_ASSIGN(WebUILoginView);

Powered by Google App Engine
This is Rietveld 408576698