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

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

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. 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
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/extensions/external_install_manager.h" 5 #include "chrome/browser/extensions/external_install_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if (!IsUnacknowledgedExternalExtension(extension)) 188 if (!IsUnacknowledgedExternalExtension(extension))
189 return; 189 return;
190 190
191 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_INSTALLED); 191 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_INSTALLED);
192 192
193 UpdateExternalExtensionAlert(); 193 UpdateExternalExtensionAlert();
194 } 194 }
195 195
196 void ExternalInstallManager::OnExtensionUninstalled( 196 void ExternalInstallManager::OnExtensionUninstalled(
197 content::BrowserContext* browser_context, 197 content::BrowserContext* browser_context,
198 const Extension* extension) { 198 const Extension* extension,
199 extensions::UninstallReason reason) {
199 if (IsUnacknowledgedExternalExtension(extension)) 200 if (IsUnacknowledgedExternalExtension(extension))
200 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_UNINSTALLED); 201 LogExternalExtensionEvent(extension, EXTERNAL_EXTENSION_UNINSTALLED);
201 } 202 }
202 203
203 bool ExternalInstallManager::IsUnacknowledgedExternalExtension( 204 bool ExternalInstallManager::IsUnacknowledgedExternalExtension(
204 const Extension* extension) const { 205 const Extension* extension) const {
205 if (!FeatureSwitch::prompt_for_external_extensions()->IsEnabled()) 206 if (!FeatureSwitch::prompt_for_external_extensions()->IsEnabled())
206 return false; 207 return false;
207 208
208 return (Manifest::IsExternalLocation(extension->location()) && 209 return (Manifest::IsExternalLocation(extension->location()) &&
(...skipping 12 matching lines...) Expand all
221 // registry observer) for this, but the ExtensionUnloaded notification is 222 // registry observer) for this, but the ExtensionUnloaded notification is
222 // not sent out if the extension is disabled (which it is here). 223 // not sent out if the extension is disabled (which it is here).
223 if (error_.get() && 224 if (error_.get() &&
224 content::Details<const Extension>(details).ptr()->id() == 225 content::Details<const Extension>(details).ptr()->id() ==
225 error_->extension_id()) { 226 error_->extension_id()) {
226 RemoveExternalInstallError(); 227 RemoveExternalInstallError();
227 } 228 }
228 } 229 }
229 230
230 } // namespace extensions 231 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_install_manager.h ('k') | chrome/browser/extensions/shared_module_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698