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

Side by Side Diff: chrome/browser/apps/drive/drive_app_provider.cc

Issue 386033002: Prune shared extendion module after extension updating. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review issues Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/apps/drive/drive_app_provider.h" 5 #include "chrome/browser/apps/drive/drive_app_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 for (size_t i = 0; i < drive_apps_.size(); ++i) { 216 for (size_t i = 0; i < drive_apps_.size(); ++i) {
217 AddOrUpdateDriveApp(drive_apps_[i]); 217 AddOrUpdateDriveApp(drive_apps_[i]);
218 } 218 }
219 SchedulePendingConverters(); 219 SchedulePendingConverters();
220 } 220 }
221 221
222 void DriveAppProvider::OnExtensionInstalled( 222 void DriveAppProvider::OnExtensionInstalled(
223 content::BrowserContext* browser_context, 223 content::BrowserContext* browser_context,
224 const Extension* extension) { 224 const Extension* extension,
225 bool is_update) {
225 // Bail if the |extension| is installed from a converter. The post install 226 // Bail if the |extension| is installed from a converter. The post install
226 // processing will be handled in OnLocalAppConverted. 227 // processing will be handled in OnLocalAppConverted.
227 if (!pending_converters_.empty() && 228 if (!pending_converters_.empty() &&
228 pending_converters_.front()->IsInstalling(extension->id())) { 229 pending_converters_.front()->IsInstalling(extension->id())) {
229 return; 230 return;
230 } 231 }
231 232
232 // Only user installed app reaches here. If it is mapped, make sure it is not 233 // Only user installed app reaches here. If it is mapped, make sure it is not
233 // tagged as generated. 234 // tagged as generated.
234 const std::string drive_app_id = mapping_->GetDriveApp(extension->id()); 235 const std::string drive_app_id = mapping_->GetDriveApp(extension->id());
(...skipping 22 matching lines...) Expand all
257 void DriveAppProvider::OnExtensionUninstalled( 258 void DriveAppProvider::OnExtensionUninstalled(
258 content::BrowserContext* browser_context, 259 content::BrowserContext* browser_context,
259 const Extension* extension) { 260 const Extension* extension) {
260 std::string drive_app_id = mapping_->GetDriveApp(extension->id()); 261 std::string drive_app_id = mapping_->GetDriveApp(extension->id());
261 if (drive_app_id.empty()) 262 if (drive_app_id.empty())
262 return; 263 return;
263 264
264 service_bridge_->GetAppRegistry()->UninstallApp( 265 service_bridge_->GetAppRegistry()->UninstallApp(
265 drive_app_id, base::Bind(&IgnoreUninstallResult)); 266 drive_app_id, base::Bind(&IgnoreUninstallResult));
266 } 267 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/drive/drive_app_provider.h ('k') | chrome/browser/extensions/api/management/management_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698