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

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

Issue 14238037: Made it possible to tell whether an extension is being installed or updated. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added extra check. 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
OLDNEW
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/extensions/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 installer->download_url() == download_item_->GetURL() && 240 installer->download_url() == download_item_->GetURL() &&
241 installer->profile()->IsSameProfile(profile_)) { 241 installer->profile()->IsSameProfile(profile_)) {
242 ReportFailure(kInstallCanceledError, FAILURE_REASON_CANCELLED); 242 ReportFailure(kInstallCanceledError, FAILURE_REASON_CANCELLED);
243 } 243 }
244 break; 244 break;
245 } 245 }
246 246
247 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { 247 case chrome::NOTIFICATION_EXTENSION_INSTALLED: {
248 CHECK(profile_->IsSameProfile(content::Source<Profile>(source).ptr())); 248 CHECK(profile_->IsSameProfile(content::Source<Profile>(source).ptr()));
249 const Extension* extension = 249 const Extension* extension =
250 content::Details<const Extension>(details).ptr(); 250 content::Details<const InstalledExtensionInfo>(details)->extension;
251 if (id_ == extension->id()) 251 if (id_ == extension->id())
252 ReportSuccess(); 252 ReportSuccess();
253 break; 253 break;
254 } 254 }
255 255
256 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: { 256 case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: {
257 CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr(); 257 CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr();
258 CHECK(crx_installer); 258 CHECK(crx_installer);
259 if (!profile_->IsSameProfile(crx_installer->profile())) 259 if (!profile_->IsSameProfile(crx_installer->profile()))
260 return; 260 return;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 void WebstoreInstaller::ReportSuccess() { 424 void WebstoreInstaller::ReportSuccess() {
425 if (delegate_) { 425 if (delegate_) {
426 delegate_->OnExtensionInstallSuccess(id_); 426 delegate_->OnExtensionInstallSuccess(id_);
427 delegate_ = NULL; 427 delegate_ = NULL;
428 } 428 }
429 429
430 Release(); // Balanced in Start(). 430 Release(); // Balanced in Start().
431 } 431 }
432 432
433 } // namespace extensions 433 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698