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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 14993013: Windows: When an app is updated and its name changes, recreate shortcuts. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to reviewer feedback. Created 7 years, 7 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
« no previous file with comments | « apps/shortcut_manager.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after
2418 CHECK(extension); 2418 CHECK(extension);
2419 delayed_updates_for_idle_.Remove(extension_id); 2419 delayed_updates_for_idle_.Remove(extension_id);
2420 2420
2421 if (!extension_prefs_->FinishDelayedInstallInfo(extension_id)) 2421 if (!extension_prefs_->FinishDelayedInstallInfo(extension_id))
2422 NOTREACHED(); 2422 NOTREACHED();
2423 2423
2424 FinishInstallation(extension); 2424 FinishInstallation(extension);
2425 } 2425 }
2426 2426
2427 void ExtensionService::FinishInstallation(const Extension* extension) { 2427 void ExtensionService::FinishInstallation(const Extension* extension) {
2428 bool is_update = GetInstalledExtension(extension->id()) != NULL; 2428 const extensions::Extension* existing_extension =
2429 extensions::InstalledExtensionInfo details(extension, is_update); 2429 GetInstalledExtension(extension->id());
2430 bool is_update = false;
2431 std::string old_name;
2432 if (existing_extension) {
2433 is_update = true;
2434 old_name = existing_extension->name();
2435 }
2436 extensions::InstalledExtensionInfo details(extension, is_update, old_name);
2430 content::NotificationService::current()->Notify( 2437 content::NotificationService::current()->Notify(
2431 chrome::NOTIFICATION_EXTENSION_INSTALLED, 2438 chrome::NOTIFICATION_EXTENSION_INSTALLED,
2432 content::Source<Profile>(profile_), 2439 content::Source<Profile>(profile_),
2433 content::Details<const extensions::InstalledExtensionInfo>(&details)); 2440 content::Details<const extensions::InstalledExtensionInfo>(&details));
2434 2441
2435 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension); 2442 bool unacknowledged_external = IsUnacknowledgedExternalExtension(extension);
2436 2443
2437 // Unpacked extensions default to allowing file access, but if that has been 2444 // Unpacked extensions default to allowing file access, but if that has been
2438 // overridden, don't reset the value. 2445 // overridden, don't reset the value.
2439 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && 2446 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) &&
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 } 3109 }
3103 3110
3104 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { 3111 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) {
3105 update_observers_.AddObserver(observer); 3112 update_observers_.AddObserver(observer);
3106 } 3113 }
3107 3114
3108 void ExtensionService::RemoveUpdateObserver( 3115 void ExtensionService::RemoveUpdateObserver(
3109 extensions::UpdateObserver* observer) { 3116 extensions::UpdateObserver* observer) {
3110 update_observers_.RemoveObserver(observer); 3117 update_observers_.RemoveObserver(observer);
3111 } 3118 }
OLDNEW
« no previous file with comments | « apps/shortcut_manager.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698