| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 NOTREACHED(); | 145 NOTREACHED(); |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 | 148 |
| 149 if (!extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile())) | 149 if (!extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile())) |
| 150 return; | 150 return; |
| 151 | 151 |
| 152 DVLOG(2) << service() << ": OnAppInstalled: " << app_id.substr(0, 8); | 152 DVLOG(2) << service() << ": OnAppInstalled: " << app_id.substr(0, 8); |
| 153 ExtensionAppItem* existing_item = GetExtensionAppItem(app_id); | 153 ExtensionAppItem* existing_item = GetExtensionAppItem(app_id); |
| 154 if (existing_item) { | 154 if (existing_item) { |
| 155 existing_item->UpdateIcon(); | 155 existing_item->Reload(); |
| 156 if (service()) | 156 if (service()) |
| 157 service()->UpdateItem(existing_item); | 157 service()->UpdateItem(existing_item); |
| 158 return; | 158 return; |
| 159 } | 159 } |
| 160 | 160 |
| 161 InsertApp(CreateAppItem(app_id, "", gfx::ImageSkia(), | 161 InsertApp(CreateAppItem(app_id, "", gfx::ImageSkia(), |
| 162 extension->is_platform_app())); | 162 extension->is_platform_app())); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ExtensionAppModelBuilder::OnAppUpdated( | 165 void ExtensionAppModelBuilder::OnAppUpdated( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 app_list::AppListItem* item = item_list->item_at(idx + 1); | 270 app_list::AppListItem* item = item_list->item_at(idx + 1); |
| 271 if (item->GetItemType() == ExtensionAppItem::kItemType) { | 271 if (item->GetItemType() == ExtensionAppItem::kItemType) { |
| 272 next = static_cast<ExtensionAppItem*>(item); | 272 next = static_cast<ExtensionAppItem*>(item); |
| 273 break; | 273 break; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 // item->Move will call set_position, overriding the item's position. | 276 // item->Move will call set_position, overriding the item's position. |
| 277 if (prev || next) | 277 if (prev || next) |
| 278 static_cast<ExtensionAppItem*>(item)->Move(prev, next); | 278 static_cast<ExtensionAppItem*>(item)->Move(prev, next); |
| 279 } | 279 } |
| OLD | NEW |