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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const extensions::Extension* extension, | 153 const extensions::Extension* extension, |
154 extensions::UnloadedExtensionInfo::Reason reason) { | 154 extensions::UnloadedExtensionInfo::Reason reason) { |
155 ExtensionAppItem* item = GetExtensionAppItem(extension->id()); | 155 ExtensionAppItem* item = GetExtensionAppItem(extension->id()); |
156 if (!item) | 156 if (!item) |
157 return; | 157 return; |
158 item->UpdateIcon(); | 158 item->UpdateIcon(); |
159 } | 159 } |
160 | 160 |
161 void ExtensionAppModelBuilder::OnExtensionUninstalled( | 161 void ExtensionAppModelBuilder::OnExtensionUninstalled( |
162 content::BrowserContext* browser_context, | 162 content::BrowserContext* browser_context, |
163 const extensions::Extension* extension) { | 163 const extensions::Extension* extension, |
| 164 extensions::UninstallReason reason) { |
164 if (service_) { | 165 if (service_) { |
165 DVLOG(2) << service_ << ": OnExtensionUninstalled: " | 166 DVLOG(2) << service_ << ": OnExtensionUninstalled: " |
166 << extension->id().substr(0, 8); | 167 << extension->id().substr(0, 8); |
167 service_->RemoveItem(extension->id()); | 168 service_->RemoveItem(extension->id()); |
168 return; | 169 return; |
169 } | 170 } |
170 model_->DeleteItem(extension->id()); | 171 model_->DeleteItem(extension->id()); |
171 } | 172 } |
172 | 173 |
173 void ExtensionAppModelBuilder::OnDisabledExtensionUpdated( | 174 void ExtensionAppModelBuilder::OnDisabledExtensionUpdated( |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 app_list::AppListItem* item = item_list->item_at(idx + 1); | 316 app_list::AppListItem* item = item_list->item_at(idx + 1); |
316 if (item->GetItemType() == ExtensionAppItem::kItemType) { | 317 if (item->GetItemType() == ExtensionAppItem::kItemType) { |
317 next = static_cast<ExtensionAppItem*>(item); | 318 next = static_cast<ExtensionAppItem*>(item); |
318 break; | 319 break; |
319 } | 320 } |
320 } | 321 } |
321 // item->Move will call set_position, overriding the item's position. | 322 // item->Move will call set_position, overriding the item's position. |
322 if (prev || next) | 323 if (prev || next) |
323 static_cast<ExtensionAppItem*>(item)->Move(prev, next); | 324 static_cast<ExtensionAppItem*>(item)->Move(prev, next); |
324 } | 325 } |
OLD | NEW |