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

Unified Diff: chrome/browser/chromeos/login/webui_screen_locker.h

Issue 8573004: Grab inputs on WebUI screen locker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move grab failure functions to anonymous namespace. Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/webui_screen_locker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/webui_screen_locker.h
diff --git a/chrome/browser/chromeos/login/webui_screen_locker.h b/chrome/browser/chromeos/login/webui_screen_locker.h
index 926722140f6c21734287d1efad0d762ef2d3be36..b27fc540a18a7cb3c1685ee4cb5ff4ee57dbb759 100644
--- a/chrome/browser/chromeos/login/webui_screen_locker.h
+++ b/chrome/browser/chromeos/login/webui_screen_locker.h
@@ -35,6 +35,9 @@ class WebUIScreenLocker : public WebUILoginView,
public:
explicit WebUIScreenLocker(ScreenLocker* screen_locker);
+ // Called when the GTK grab breaks.
+ void HandleGtkGrabBroke();
+
// ScreenLockerDelegate implementation:
virtual void LockScreen(bool unlock_on_input) OVERRIDE;
virtual void ScreenLockReady() OVERRIDE;
@@ -67,9 +70,28 @@ class WebUIScreenLocker : public WebUILoginView,
private:
virtual ~WebUIScreenLocker();
+ // Called when the window manager is ready to handle locked state.
+ void OnWindowManagerReady();
+
+ // Called when the all inputs are grabbed.
+ void OnGrabInputs();
+
+ // Clear current GTK grab.
+ void ClearGtkGrab();
+
+ // Try to grab all inputs. It initiates another try if it fails to
+ // grab and the retry count is within a limit, or fails with CHECK.
+ void TryGrabAllInputs();
+
+ // This method tries to steal pointer/keyboard grab from other
+ // client by sending events that will hopefully close menus or windows
+ // that have the grab.
+ void TryUngrabOtherClients();
+
// Event handler for client-event.
CHROMEGTK_CALLBACK_1(WebUIScreenLocker, void, OnClientEvent, GdkEventClient*)
+ // The screen locker window.
views::Widget* lock_window_;
// Login UI implementation instance.
@@ -78,6 +100,21 @@ class WebUIScreenLocker : public WebUILoginView,
// Used for user image changed notifications.
content::NotificationRegistrar registrar_;
+ // True if the screen locker's window has been drawn.
+ bool drawn_;
+
+ // True if both mouse input and keyboard input are grabbed.
+ bool input_grabbed_;
+
+ base::WeakPtrFactory<WebUIScreenLocker> weak_factory_;
+
+ // The number times the widget tried to grab all focus.
+ int grab_failure_count_;
+
+ // Status of keyboard and mouse grab.
+ GdkGrabStatus kbd_grab_status_;
+ GdkGrabStatus mouse_grab_status_;
+
DISALLOW_COPY_AND_ASSIGN(WebUIScreenLocker);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/webui_screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698