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

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

Issue 2894443002: arc: Set custom icon in shelf for ARC apps. (Closed)
Patch Set: comments addressed 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..614d58ce5467ca6bc4f84f634b76541b53aaa5b6 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,7 @@ void AppWindowLauncherItemController::AddWindow(ui::BaseWindow* app_window) {
aura::Window* window = app_window->GetNativeWindow();
if (window)
observed_windows_.Add(window);
+ UpdateLauncherItem();
}
AppWindowLauncherItemController::WindowList::iterator
@@ -49,8 +50,8 @@ void AppWindowLauncherItemController::RemoveWindow(ui::BaseWindow* app_window) {
NOTREACHED();
return;
}
- OnWindowRemoved(app_window);
windows_.erase(iter);
+ UpdateLauncherItem();
}
ui::BaseWindow* AppWindowLauncherItemController::GetAppWindow(
@@ -65,6 +66,7 @@ void AppWindowLauncherItemController::SetActiveWindow(aura::Window* window) {
ui::BaseWindow* app_window = GetAppWindow(window);
if (app_window)
last_active_window_ = app_window;
+ UpdateLauncherItem();
}
AppWindowLauncherItemController*
@@ -119,6 +121,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();
Luis Héctor Chávez 2017/05/18 18:09:40 nit: if (windows_.empty()) return nullptr retur
khmel 2017/05/18 20:27:52 Done.
msw 2017/05/18 22:03:39 fwiw, I prefer ternary statements, but style prefe
khmel 2017/05/18 22:40:02 Acknowledged.
+}
+
void AppWindowLauncherItemController::OnWindowPropertyChanged(
aura::Window* window,
const void* key,

Powered by Google App Engine
This is Rietveld 408576698