| 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/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 current_version_ = | 407 current_version_ = |
| 408 frontend_weak_->extension_prefs()->GetVersionString(extension_->id()); | 408 frontend_weak_->extension_prefs()->GetVersionString(extension_->id()); |
| 409 | 409 |
| 410 // TODO(asargent) - remove this when we fully deprecate the old install api. | 410 // TODO(asargent) - remove this when we fully deprecate the old install api. |
| 411 ClearWhitelistedInstallId(extension_->id()); | 411 ClearWhitelistedInstallId(extension_->id()); |
| 412 | 412 |
| 413 bool whitelisted = false; | 413 bool whitelisted = false; |
| 414 scoped_ptr<CrxInstaller::WhitelistEntry> entry( | 414 scoped_ptr<CrxInstaller::WhitelistEntry> entry( |
| 415 RemoveWhitelistEntry(extension_->id())); | 415 RemoveWhitelistEntry(extension_->id())); |
| 416 if (is_gallery_install() && entry.get() && original_manifest_.get()) { | 416 if (is_gallery_install() && entry.get() && original_manifest_.get()) { |
| 417 whitelisted = true; |
| 418 if (entry->use_app_installed_bubble) |
| 419 client_->set_use_app_installed_bubble(true); |
| 420 if (entry->skip_post_install_ui) |
| 421 client_->set_skip_post_install_ui(true); |
| 422 |
| 417 if (!(original_manifest_->Equals(entry->parsed_manifest.get()))) { | 423 if (!(original_manifest_->Equals(entry->parsed_manifest.get()))) { |
| 418 ReportFailureFromUIThread( | 424 ReportFailureFromUIThread( |
| 419 l10n_util::GetStringUTF16(IDS_EXTENSION_MANIFEST_INVALID)); | 425 l10n_util::GetStringUTF16(IDS_EXTENSION_MANIFEST_INVALID)); |
| 420 return; | 426 return; |
| 421 } | 427 } |
| 422 whitelisted = true; | |
| 423 if (entry->use_app_installed_bubble) | |
| 424 client_->set_use_app_installed_bubble(true); | |
| 425 if (entry->skip_post_install_ui) | |
| 426 client_->set_skip_post_install_ui(true); | |
| 427 } | 428 } |
| 428 | 429 |
| 429 if (client_ && | 430 if (client_ && |
| 430 (!allow_silent_install_ || !whitelisted)) { | 431 (!allow_silent_install_ || !whitelisted)) { |
| 431 AddRef(); // Balanced in Proceed() and Abort(). | 432 AddRef(); // Balanced in Proceed() and Abort(). |
| 432 client_->ConfirmInstall(this, extension_.get()); | 433 client_->ConfirmInstall(this, extension_.get()); |
| 433 } else { | 434 } else { |
| 434 if (!BrowserThread::PostTask( | 435 if (!BrowserThread::PostTask( |
| 435 BrowserThread::FILE, FROM_HERE, | 436 BrowserThread::FILE, FROM_HERE, |
| 436 base::Bind(&CrxInstaller::CompleteInstall, this))) | 437 base::Bind(&CrxInstaller::CompleteInstall, this))) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 // Some users (such as the download shelf) need to know when a | 608 // Some users (such as the download shelf) need to know when a |
| 608 // CRXInstaller is done. Listening for the EXTENSION_* events | 609 // CRXInstaller is done. Listening for the EXTENSION_* events |
| 609 // is problematic because they don't know anything about the | 610 // is problematic because they don't know anything about the |
| 610 // extension before it is unpacked, so they cannot filter based | 611 // extension before it is unpacked, so they cannot filter based |
| 611 // on the extension. | 612 // on the extension. |
| 612 content::NotificationService::current()->Notify( | 613 content::NotificationService::current()->Notify( |
| 613 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 614 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 614 content::Source<CrxInstaller>(this), | 615 content::Source<CrxInstaller>(this), |
| 615 content::Details<const Extension>(extension)); | 616 content::Details<const Extension>(extension)); |
| 616 } | 617 } |
| OLD | NEW |