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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 existing_item->Reload(); | 135 existing_item->Reload(); |
136 if (service()) | 136 if (service()) |
137 service()->UpdateItem(existing_item); | 137 service()->UpdateItem(existing_item); |
138 return; | 138 return; |
139 } | 139 } |
140 | 140 |
141 InsertApp(CreateAppItem(app_id, "", gfx::ImageSkia(), | 141 InsertApp(CreateAppItem(app_id, "", gfx::ImageSkia(), |
142 extension->is_platform_app())); | 142 extension->is_platform_app())); |
143 } | 143 } |
144 | 144 |
145 void ExtensionAppModelBuilder::OnAppUpdated( | |
146 content::BrowserContext* browser_context, | |
147 const std::string& app_id) { | |
148 ExtensionAppItem* item = GetExtensionAppItem(app_id); | |
149 if (!item) | |
150 return; | |
151 item->UpdateIcon(); | |
152 } | |
153 | |
154 void ExtensionAppModelBuilder::OnAppUninstalled( | 145 void ExtensionAppModelBuilder::OnAppUninstalled( |
155 content::BrowserContext* browser_context, | 146 content::BrowserContext* browser_context, |
156 const std::string& app_id) { | 147 const std::string& app_id) { |
157 if (service()) { | 148 if (service()) { |
158 DVLOG(2) << service() << ": OnAppUninstalled: " << app_id.substr(0, 8); | 149 DVLOG(2) << service() << ": OnAppUninstalled: " << app_id.substr(0, 8); |
159 service()->RemoveUninstalledItem(app_id); | 150 service()->RemoveUninstalledItem(app_id); |
160 return; | 151 return; |
161 } | 152 } |
162 model()->DeleteUninstalledItem(app_id); | 153 model()->DeleteUninstalledItem(app_id); |
163 } | 154 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 "", | 209 "", |
219 gfx::ImageSkia(), | 210 gfx::ImageSkia(), |
220 (*app)->is_platform_app())); | 211 (*app)->is_platform_app())); |
221 } | 212 } |
222 } | 213 } |
223 | 214 |
224 ExtensionAppItem* ExtensionAppModelBuilder::GetExtensionAppItem( | 215 ExtensionAppItem* ExtensionAppModelBuilder::GetExtensionAppItem( |
225 const std::string& extension_id) { | 216 const std::string& extension_id) { |
226 return static_cast<ExtensionAppItem*>(GetAppItem(extension_id)); | 217 return static_cast<ExtensionAppItem*>(GetAppItem(extension_id)); |
227 } | 218 } |
OLD | NEW |