OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/extension_app_model_builder.h" | 5 #include "chrome/browser/ui/app_list/extension_app_model_builder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 const Extension* extension) { | 177 const Extension* extension) { |
178 if (service_) { | 178 if (service_) { |
179 DVLOG(2) << service_ << ": OnExtensionUninstalled: " | 179 DVLOG(2) << service_ << ": OnExtensionUninstalled: " |
180 << extension->id().substr(0, 8); | 180 << extension->id().substr(0, 8); |
181 service_->RemoveItem(extension->id()); | 181 service_->RemoveItem(extension->id()); |
182 return; | 182 return; |
183 } | 183 } |
184 model_->DeleteItem(extension->id()); | 184 model_->DeleteItem(extension->id()); |
185 } | 185 } |
186 | 186 |
187 void ExtensionAppModelBuilder::OnAppsReordered() { | |
188 // Do nothing; App List order does not track extensions order. | |
189 } | |
190 | |
191 void ExtensionAppModelBuilder::OnAppInstalledToAppList( | 187 void ExtensionAppModelBuilder::OnAppInstalledToAppList( |
192 const std::string& extension_id) { | 188 const std::string& extension_id) { |
193 SetHighlightedApp(extension_id); | 189 SetHighlightedApp(extension_id); |
194 } | 190 } |
195 | 191 |
196 void ExtensionAppModelBuilder::OnShutdown() { | 192 void ExtensionAppModelBuilder::OnShutdown() { |
197 if (tracker_) { | 193 if (tracker_) { |
198 tracker_->RemoveObserver(this); | 194 tracker_->RemoveObserver(this); |
199 tracker_ = NULL; | 195 tracker_ = NULL; |
200 } | 196 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 app_list::AppListItem* item = item_list->item_at(idx + 1); | 307 app_list::AppListItem* item = item_list->item_at(idx + 1); |
312 if (item->GetItemType() == ExtensionAppItem::kItemType) { | 308 if (item->GetItemType() == ExtensionAppItem::kItemType) { |
313 next = static_cast<ExtensionAppItem*>(item); | 309 next = static_cast<ExtensionAppItem*>(item); |
314 break; | 310 break; |
315 } | 311 } |
316 } | 312 } |
317 // item->Move will call set_position, overriding the item's position. | 313 // item->Move will call set_position, overriding the item's position. |
318 if (prev || next) | 314 if (prev || next) |
319 static_cast<ExtensionAppItem*>(item)->Move(prev, next); | 315 static_cast<ExtensionAppItem*>(item)->Move(prev, next); |
320 } | 316 } |
OLD | NEW |