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

Unified Diff: chrome/browser/ui/exclusive_access/exclusive_access_bubble.h

Issue 1254543002: Change exclusive access popup behaviour with simplified-fullscreen-ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@exclusiveaccess-remove-confirmation
Patch Set: Respond to nits. Created 5 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/exclusive_access/exclusive_access_bubble.h
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h
index 57f55c0c7a1decd1c63e171690c9be1560a2d4b5..63bbc48ae7d6bd10f105067f83742384edfc9149 100644
--- a/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h
+++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble.h
@@ -20,6 +20,15 @@ class Rect;
// Bubble that informs the user when an exclusive access state is in effect and
// as to how to exit out of the state. Currently there are two exclusive access
// state, namely fullscreen and mouse lock.
+//
+// Notification display design note: if the #simplified-fullscreen-ui flag is
+// enabled, the bubble has the following behaviour:
+// - Upon taking exclusive access, wait kDebounceNotificationsTimeMs, then for
+// user input, before displaying the bubble.
+// - The bubble is shown for kIdleTimeMs, then hides.
+// - After a bubble has been shown, notifications are suppressed for
+// kSnoozeNotificationsTimeMs, to avoid bothering the user. After this time
+// has elapsed, the next user input re-displays the bubble.
class ExclusiveAccessBubble : public gfx::AnimationDelegate {
public:
explicit ExclusiveAccessBubble(ExclusiveAccessManager* manager,
@@ -31,6 +40,9 @@ class ExclusiveAccessBubble : public gfx::AnimationDelegate {
static const int kPaddingPx; // Amount of padding around the link
static const int kInitialDelayMs; // Initial time bubble remains onscreen
static const int kIdleTimeMs; // Time before mouse idle triggers hide
+ // See notification display design note above.
+ static const int kDebounceNotificationsTimeMs;
+ static const int kSnoozeNotificationsTimeMs;
static const int kPositionCheckHz; // How fast to check the mouse position
static const int kSlideInRegionHeightPx;
// Height of region triggering
@@ -95,13 +107,20 @@ class ExclusiveAccessBubble : public gfx::AnimationDelegate {
ExclusiveAccessBubbleType bubble_type_;
private:
- // Timer to delay before allowing the bubble to hide after it's initially
- // shown.
- base::OneShotTimer<ExclusiveAccessBubble> initial_delay_;
+ // When this timer is active, prevent the bubble from hiding. This ensures it
+ // will be displayed for a minimum amount of time (which can be extended by
+ // the user moving the mouse to the top of the screen and holding it there).
+ base::OneShotTimer<ExclusiveAccessBubble> hide_timeout_;
// Timer to see how long the mouse has been idle.
base::OneShotTimer<ExclusiveAccessBubble> idle_timeout_;
+ // When this timer has elapsed, on the next mouse input, we will notify the
+ // user about any currently active exclusive access. This is used to enact
+ // both the initial debounce period, and the snooze period before re-notifying
+ // the user (see notification display design note above).
+ base::OneShotTimer<ExclusiveAccessBubble> suppress_notify_timeout_;
+
// Timer to poll the current mouse position. We can't just listen for mouse
// events without putting a non-empty HWND onscreen (or hooking Windows, which
// has other problems), so instead we run a low-frequency poller to see if the
« no previous file with comments | « no previous file | chrome/browser/ui/exclusive_access/exclusive_access_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698