| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |