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

Unified Diff: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc

Issue 2883193002: WIP
Patch Set: git cl try Created 3 years, 7 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/ash/launcher/app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
index 11032d2c9b43aa5320f6e96f104a30d2836894fb..05a335ea59d6280ed3bd0758e5bd7543096f8e8d 100644
--- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
@@ -27,6 +27,8 @@ void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) {
aura::Window* window = app_window->GetNativeWindow();
if (window)
observed_windows_.Add(window);
+ if (GetLastActiveWindow() == app_window)
+ OnActiveWindowChanged(app_window);
}
AppWindowLauncherItemController::WindowList::iterator
@@ -49,8 +51,8 @@ void AppWindowLauncherItemController::RemoveWindow(ui::BaseWindow* app_window) {
NOTREACHED();
return;
}
- OnWindowRemoved(app_window);
windows_.erase(iter);
+ OnActiveWindowChanged(GetLastActiveWindow());
}
ui::BaseWindow* AppWindowLauncherItemController::GetAppWindow(
@@ -65,6 +67,7 @@ void AppWindowLauncherItemController::SetActiveWindow(aura::Window* window) {
ui::BaseWindow* app_window = GetAppWindow(window);
if (app_window)
last_active_window_ = app_window;
+ OnActiveWindowChanged(GetLastActiveWindow());
}
AppWindowLauncherItemController*
@@ -119,6 +122,12 @@ void AppWindowLauncherItemController::ActivateIndexedApp(size_t index) {
ShowAndActivateOrMinimize(*it);
}
+ui::BaseWindow* AppWindowLauncherItemController::GetLastActiveWindow() {
+ if (last_active_window_)
+ return last_active_window_;
+ return windows_.empty() ? nullptr : windows_.front();
+}
+
void AppWindowLauncherItemController::OnWindowPropertyChanged(
aura::Window* window,
const void* key,
« no previous file with comments | « chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h ('k') | chrome/browser/ui/ash/launcher/arc_app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698