| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 } | 491 } |
| 492 | 492 |
| 493 void CrxInstaller::CompleteInstall() { | 493 void CrxInstaller::CompleteInstall() { |
| 494 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 494 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 495 | 495 |
| 496 if (!current_version_.empty()) { | 496 if (!current_version_.empty()) { |
| 497 Version current_version(current_version_); | 497 Version current_version(current_version_); |
| 498 if (current_version.CompareTo(*(extension_->version())) > 0) { | 498 if (current_version.CompareTo(*(extension_->version())) > 0) { |
| 499 ReportFailureFromFileThread( | 499 ReportFailureFromFileThread( |
| 500 CrxInstallerError( | 500 CrxInstallerError( |
| 501 l10n_util::GetStringUTF16(IDS_EXTENSION_CANT_DOWNGRADE_VERSION))); | 501 l10n_util::GetStringUTF16(extension_->is_app() ? |
| 502 IDS_APP_CANT_DOWNGRADE_VERSION : |
| 503 IDS_EXTENSION_CANT_DOWNGRADE_VERSION))); |
| 502 return; | 504 return; |
| 503 } | 505 } |
| 504 } | 506 } |
| 505 | 507 |
| 506 // See how long extension install paths are. This is important on | 508 // See how long extension install paths are. This is important on |
| 507 // windows, because file operations may fail if the path to a file | 509 // windows, because file operations may fail if the path to a file |
| 508 // exceeds a small constant. See crbug.com/69693 . | 510 // exceeds a small constant. See crbug.com/69693 . |
| 509 UMA_HISTOGRAM_CUSTOM_COUNTS( | 511 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 510 "Extensions.CrxInstallDirPathLength", | 512 "Extensions.CrxInstallDirPathLength", |
| 511 install_directory_.value().length(), 0, 500, 100); | 513 install_directory_.value().length(), 0, 500, 100); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 // is problematic because they don't know anything about the | 647 // is problematic because they don't know anything about the |
| 646 // extension before it is unpacked, so they cannot filter based | 648 // extension before it is unpacked, so they cannot filter based |
| 647 // on the extension. | 649 // on the extension. |
| 648 content::NotificationService::current()->Notify( | 650 content::NotificationService::current()->Notify( |
| 649 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 651 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 650 content::Source<CrxInstaller>(this), | 652 content::Source<CrxInstaller>(this), |
| 651 content::Details<const Extension>(extension)); | 653 content::Details<const Extension>(extension)); |
| 652 } | 654 } |
| 653 | 655 |
| 654 } // namespace extensions | 656 } // namespace extensions |
| OLD | NEW |