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

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

Issue 225053004: Refactor views app list services to allow more code sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+sim30 Created 6 years, 8 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
Index: chrome/browser/ui/views/app_list/win/activation_tracker_win.cc
diff --git a/chrome/browser/ui/views/app_list/win/activation_tracker_win.cc b/chrome/browser/ui/views/app_list/win/activation_tracker_win.cc
index 932fc7e2f1e4bcdde6fc3cdf7f2d3fa2d62ff4ef..f4ab2fe2bbae529a653286fba1bc3f0e75d62970 100644
--- a/chrome/browser/ui/views/app_list/win/activation_tracker_win.cc
+++ b/chrome/browser/ui/views/app_list/win/activation_tracker_win.cc
@@ -5,6 +5,8 @@
#include "chrome/browser/ui/views/app_list/win/activation_tracker_win.h"
#include "base/time/time.h"
+#include "chrome/browser/ui/app_list/app_list_shower_views.h"
+#include "chrome/browser/ui/views/app_list/win/app_list_service_win.h"
#include "ui/app_list/views/app_list_view.h"
#include "ui/views/widget/widget.h"
@@ -16,17 +18,15 @@ const int kFocusCheckIntervalMS = 250;
} // namespace
-ActivationTrackerWin::ActivationTrackerWin(
- app_list::AppListView* view,
- const base::Closure& on_should_dismiss)
- : view_(view),
- on_should_dismiss_(on_should_dismiss),
+ActivationTrackerWin::ActivationTrackerWin(AppListServiceWin* service)
+ : service_(service),
taskbar_has_focus_(false) {
- view_->AddObserver(this);
+ service_->shower().app_list()->AddObserver(this);
}
ActivationTrackerWin::~ActivationTrackerWin() {
- view_->RemoveObserver(this);
+ DCHECK(service_->shower().app_list());
+ service_->shower().app_list()->RemoveObserver(this);
timer_.Stop();
}
@@ -51,7 +51,7 @@ void ActivationTrackerWin::MaybeDismissAppList() {
if (!ShouldDismissAppList())
return;
- on_should_dismiss_.Run();
+ service_->DismissAppList();
}
bool ActivationTrackerWin::ShouldDismissAppList() {
@@ -92,7 +92,8 @@ bool ActivationTrackerWin::ShouldDismissAppList() {
while (focused_hwnd) {
// If the focused window is the right click menu (called a jump list) or
// the app list, don't hide the launcher.
- if (focused_hwnd == jump_list_hwnd || focused_hwnd == view_->GetHWND())
+ HWND app_list_hwnd = service_->shower().app_list()->GetHWND();
+ if (focused_hwnd == jump_list_hwnd || focused_hwnd == app_list_hwnd)
return false;
if (focused_hwnd == taskbar_hwnd) {

Powered by Google App Engine
This is Rietveld 408576698