| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
| 10 #include "ui/app_list/views/app_list_view_observer.h" | 10 #include "ui/app_list/views/app_list_view_observer.h" |
| 11 | 11 |
| 12 class AppListServiceWin; | 12 class AppListServiceWin; |
| 13 | 13 |
| 14 // Periodically checks to see if an AppListView has lost focus using a timer. | 14 // Periodically checks to see if an AppListView has lost focus using a timer. |
| 15 class ActivationTrackerWin : public app_list::AppListViewObserver { | 15 class ActivationTrackerWin : public app_list::AppListViewObserver { |
| 16 public: | 16 public: |
| 17 explicit ActivationTrackerWin(AppListServiceWin* service); | 17 explicit ActivationTrackerWin(AppListServiceWin* service); |
| 18 ~ActivationTrackerWin(); | 18 ~ActivationTrackerWin(); |
| 19 | 19 |
| 20 // app_list::AppListViewObserver: | 20 // app_list::AppListViewObserver: |
| 21 virtual void OnActivationChanged(views::Widget* widget, bool active) OVERRIDE; | 21 virtual void OnActivationChanged(views::Widget* widget, bool active) override; |
| 22 | 22 |
| 23 void OnViewHidden(); | 23 void OnViewHidden(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 // Dismisses the app launcher if it has lost focus and the user is not trying | 26 // Dismisses the app launcher if it has lost focus and the user is not trying |
| 27 // to pin it. | 27 // to pin it. |
| 28 void MaybeDismissAppList(); | 28 void MaybeDismissAppList(); |
| 29 | 29 |
| 30 // Determines whether the app launcher should be dismissed. This should be | 30 // Determines whether the app launcher should be dismissed. This should be |
| 31 // called at most once per timer tick, as it is not idempotent (if the taskbar | 31 // called at most once per timer tick, as it is not idempotent (if the taskbar |
| (...skipping 12 matching lines...) Expand all Loading... |
| 44 | 44 |
| 45 // Timer used to check if the taskbar or app list is active. Using a timer | 45 // Timer used to check if the taskbar or app list is active. Using a timer |
| 46 // means we don't need to hook Windows, which is apparently not possible | 46 // means we don't need to hook Windows, which is apparently not possible |
| 47 // since Vista (and is not nice at any time). | 47 // since Vista (and is not nice at any time). |
| 48 base::RepeatingTimer<ActivationTrackerWin> timer_; | 48 base::RepeatingTimer<ActivationTrackerWin> timer_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ActivationTrackerWin); | 50 DISALLOW_COPY_AND_ASSIGN(ActivationTrackerWin); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ | 53 #endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_WIN_ACTIVATION_TRACKER_WIN_H_ |
| OLD | NEW |