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

Side by Side Diff: chrome/browser/ui/exclusive_access/exclusive_access_bubble.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_ 5 #ifndef CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_
6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_ 6 #define CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_
7 7
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h" 9 #include "chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.h"
10 #include "ui/gfx/animation/animation_delegate.h" 10 #include "ui/gfx/animation/animation_delegate.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // The host the bubble is for, can be empty. 103 // The host the bubble is for, can be empty.
104 GURL url_; 104 GURL url_;
105 105
106 // The type of the bubble; controls e.g. which buttons to show. 106 // The type of the bubble; controls e.g. which buttons to show.
107 ExclusiveAccessBubbleType bubble_type_; 107 ExclusiveAccessBubbleType bubble_type_;
108 108
109 private: 109 private:
110 // When this timer is active, prevent the bubble from hiding. This ensures it 110 // When this timer is active, prevent the bubble from hiding. This ensures it
111 // will be displayed for a minimum amount of time (which can be extended by 111 // will be displayed for a minimum amount of time (which can be extended by
112 // the user moving the mouse to the top of the screen and holding it there). 112 // the user moving the mouse to the top of the screen and holding it there).
113 base::OneShotTimer<ExclusiveAccessBubble> hide_timeout_; 113 base::OneShotTimer hide_timeout_;
114 114
115 // Timer to see how long the mouse has been idle. 115 // Timer to see how long the mouse has been idle.
116 base::OneShotTimer<ExclusiveAccessBubble> idle_timeout_; 116 base::OneShotTimer idle_timeout_;
117 117
118 // When this timer has elapsed, on the next mouse input, we will notify the 118 // When this timer has elapsed, on the next mouse input, we will notify the
119 // user about any currently active exclusive access. This is used to enact 119 // user about any currently active exclusive access. This is used to enact
120 // both the initial debounce period, and the snooze period before re-notifying 120 // both the initial debounce period, and the snooze period before re-notifying
121 // the user (see notification display design note above). 121 // the user (see notification display design note above).
122 base::OneShotTimer<ExclusiveAccessBubble> suppress_notify_timeout_; 122 base::OneShotTimer suppress_notify_timeout_;
123 123
124 // Timer to poll the current mouse position. We can't just listen for mouse 124 // Timer to poll the current mouse position. We can't just listen for mouse
125 // events without putting a non-empty HWND onscreen (or hooking Windows, which 125 // events without putting a non-empty HWND onscreen (or hooking Windows, which
126 // has other problems), so instead we run a low-frequency poller to see if the 126 // has other problems), so instead we run a low-frequency poller to see if the
127 // user has moved in or out of our show/hide regions. 127 // user has moved in or out of our show/hide regions.
128 base::RepeatingTimer<ExclusiveAccessBubble> mouse_position_checker_; 128 base::RepeatingTimer mouse_position_checker_;
129 129
130 // The most recently seen mouse position, in screen coordinates. Used to see 130 // The most recently seen mouse position, in screen coordinates. Used to see
131 // if the mouse has moved since our last check. 131 // if the mouse has moved since our last check.
132 gfx::Point last_mouse_pos_; 132 gfx::Point last_mouse_pos_;
133 133
134 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubble); 134 DISALLOW_COPY_AND_ASSIGN(ExclusiveAccessBubble);
135 }; 135 };
136 136
137 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_ 137 #endif // CHROME_BROWSER_UI_EXCLUSIVE_ACCESS_EXCLUSIVE_ACCESS_BUBBLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.h ('k') | chrome/browser/ui/panels/display_settings_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698