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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: fix mac compile 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/arc_app_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
index a2d0041d332476229c8ed44048849098e17f6ed0..d307b1114f8c37eaa5e54d31180552f372874dea 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc
@@ -20,10 +20,8 @@
#include "ui/base/base_window.h"
ArcAppWindowLauncherItemController::ArcAppWindowLauncherItemController(
- const std::string& arc_app_id,
- ChromeLauncherController* owner)
- : AppWindowLauncherItemController(ash::ShelfID(arc_app_id)),
- owner_(owner) {}
+ const std::string& arc_app_id)
+ : AppWindowLauncherItemController(ash::ShelfID(arc_app_id)) {}
ArcAppWindowLauncherItemController::~ArcAppWindowLauncherItemController() {}
@@ -67,8 +65,8 @@ void ArcAppWindowLauncherItemController::ExecuteCommand(uint32_t command_id,
ash::MenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
int event_flags) {
ash::MenuItemList items;
- base::string16 app_title =
- LauncherControllerHelper::GetAppTitle(owner_->profile(), app_id());
+ base::string16 app_title = LauncherControllerHelper::GetAppTitle(
+ ChromeLauncherController::instance()->profile(), app_id());
for (auto it = windows().begin(); it != windows().end(); ++it) {
// TODO(khmel): resolve correct icon here.
size_t i = std::distance(windows().begin(), it);
@@ -82,21 +80,3 @@ ash::MenuItemList ArcAppWindowLauncherItemController::GetAppMenuItems(
return items;
}
-
-void ArcAppWindowLauncherItemController::UpdateLauncherItem() {
- const ArcAppWindow* arc_app_window =
- static_cast<const ArcAppWindow*>(GetLastActiveWindow());
- if (!arc_app_window || arc_app_window->icon().isNull()) {
- if (!image_set_by_controller())
- return;
- set_image_set_by_controller(false);
- owner_->SetLauncherItemImage(shelf_id(), gfx::ImageSkia());
- AppIconLoader* icon_loader = owner_->GetAppIconLoaderForApp(app_id());
- if (icon_loader)
- icon_loader->UpdateImage(app_id());
- return;
- }
-
- owner_->SetLauncherItemImage(shelf_id(), arc_app_window->icon());
- set_image_set_by_controller(true);
-}

Powered by Google App Engine
This is Rietveld 408576698