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

Unified Diff: chrome/browser/ui/views/app_list/win/activation_tracker_win.h

Issue 59063009: ActivationTrackerWin: General refactor, renaming and clarification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small cleanup. Created 7 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
Index: chrome/browser/ui/views/app_list/win/activation_tracker_win.h
diff --git a/chrome/browser/ui/views/app_list/win/activation_tracker_win.h b/chrome/browser/ui/views/app_list/win/activation_tracker_win.h
index 8def57152100de606a8a3bd66ba466ea0ea77e41..433f30d18215ea1c4e5e63ae95a7f40ec0d2f4f2 100644
--- a/chrome/browser/ui/views/app_list/win/activation_tracker_win.h
+++ b/chrome/browser/ui/views/app_list/win/activation_tracker_win.h
@@ -17,8 +17,8 @@ class ActivationTrackerWin : public app_list::AppListView::Observer {
const base::Closure& on_should_dismiss);
~ActivationTrackerWin();
- void RegainNextLostFocus() {
- regain_next_lost_focus_ = true;
+ void ReactivateOnNextFocusLoss() {
+ reactivate_on_next_focus_loss_ = true;
}
// app_list::AppListView::Observer overrides.
@@ -27,7 +27,17 @@ class ActivationTrackerWin : public app_list::AppListView::Observer {
void OnViewHidden();
private:
- void CheckTaskbarOrViewHasFocus();
+ // Dismisses the app launcher if it has lost focus and the user is not trying
+ // to pin it. If it is time to dismiss the app launcher, but
+ // ReactivateOnNextFocusLoss has been called, reactivates the app launcher
+ // instead of dismissing it.
+ void MaybeDismissAppList();
+
+ // Determines whether the app launcher should be dismissed. This should be
+ // called at most once per timer tick, as it is not idempotent (if the taskbar
+ // is focused, it waits until it has been called twice before dismissing the
+ // app list).
+ bool ShouldDismissAppList();
// The window to track the active state of.
app_list::AppListView* view_;
@@ -38,15 +48,14 @@ class ActivationTrackerWin : public app_list::AppListView::Observer {
// True if we are anticipating that the app list will lose focus, and we want
// to take it back. This is used when switching out of Metro mode, and the
// browser regains focus after showing the app list.
- bool regain_next_lost_focus_;
-
- // When the context menu on the app list's taskbar icon is brought up the
- // app list should not be hidden, but it should be if the taskbar is clicked
- // on. There can be a period of time when the taskbar gets focus between a
- // right mouse click and the menu showing; to prevent hiding the app launcher
- // when this happens it is kept visible if the taskbar is seen briefly without
- // the right mouse button down, but not if this happens twice in a row.
- bool preserving_focus_for_taskbar_menu_;
+ bool reactivate_on_next_focus_loss_;
+
+ // Records whether, on the previous timer tick, the taskbar had focus without
+ // the right mouse button being down. We allow the taskbar to have focus for
+ // one tick before dismissing the app list. This allows the app list to be
+ // kept visible if the taskbar is seen briefly without the right mouse button
+ // down, but not if this happens for two consecutive ticks.
+ bool taskbar_has_focus_;
// Timer used to check if the taskbar or app list is active. Using a timer
// means we don't need to hook Windows, which is apparently not possible

Powered by Google App Engine
This is Rietveld 408576698