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

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

Issue 2870683002: ash: Remove ShelfModel id conversion functions. (Closed)
Patch Set: Address comments. 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/extension_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
index 2060935035a032cf6d0cbfd9817a89945ed700f6..414b768c7cbe947bdea28f1d60ef8a5015d57503 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
@@ -153,8 +153,7 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) {
controller->AddAppWindow(app_window);
// Check for any existing pinned shelf item with a matching |shelf_id|.
- const int item_index = owner()->shelf_model()->ItemIndexByID(shelf_id);
- if (item_index < 0) {
+ if (owner()->GetItem(shelf_id) == nullptr) {
owner()->CreateAppLauncherItem(std::move(controller), status);
// Restore any existing app icon and flag as set.
if (app_window->HasCustomIcon() && !app_window->app_icon().IsEmpty()) {

Powered by Google App Engine
This is Rietveld 408576698