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

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: rebase 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..41d5953e1cda765dc682a8263440d1ea3a7683d6 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,14 @@ void AppWindowLauncherItemController::ActivateIndexedApp(size_t index) {
ShowAndActivateOrMinimize(*it);
}
+ui::BaseWindow* AppWindowLauncherItemController::GetLastActiveWindow() {
+ if (last_active_window_)
+ return last_active_window_;
+ if (windows_.empty())
+ return nullptr;
+ return 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