| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 overlapping_extension->id() != extension_->id()) { | 385 overlapping_extension->id() != extension_->id()) { |
| 386 ReportFailureFromUIThread(l10n_util::GetStringFUTF8( | 386 ReportFailureFromUIThread(l10n_util::GetStringFUTF8( |
| 387 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT, | 387 IDS_EXTENSION_OVERLAPPING_WEB_EXTENT, |
| 388 UTF8ToUTF16(overlapping_extension->name()))); | 388 UTF8ToUTF16(overlapping_extension->name()))); |
| 389 return; | 389 return; |
| 390 } | 390 } |
| 391 | 391 |
| 392 current_version_ = | 392 current_version_ = |
| 393 frontend_weak_->extension_prefs()->GetVersionString(extension_->id()); | 393 frontend_weak_->extension_prefs()->GetVersionString(extension_->id()); |
| 394 | 394 |
| 395 // First see if it's whitelisted by id (the old mechanism). | 395 // TODO(asargent) - remove this when we fully deprecate the old install api. |
| 396 bool whitelisted = ClearWhitelistedInstallId(extension_->id()) && | 396 ClearWhitelistedInstallId(extension_->id()); |
| 397 extension_->plugins().empty() && is_gallery_install_; | |
| 398 | 397 |
| 399 // Now check if there's a WhitelistEntry. | 398 bool whitelisted = false; |
| 400 scoped_ptr<CrxInstaller::WhitelistEntry> entry( | 399 scoped_ptr<CrxInstaller::WhitelistEntry> entry( |
| 401 RemoveWhitelistEntry(extension_->id())); | 400 RemoveWhitelistEntry(extension_->id())); |
| 402 if (is_gallery_install_ && entry.get() && original_manifest_.get()) { | 401 if (is_gallery_install_ && entry.get() && original_manifest_.get()) { |
| 403 if (!(original_manifest_->Equals(entry->parsed_manifest.get()))) { | 402 if (!(original_manifest_->Equals(entry->parsed_manifest.get()))) { |
| 404 ReportFailureFromUIThread( | 403 ReportFailureFromUIThread( |
| 405 l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID)); | 404 l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID)); |
| 406 return; | 405 return; |
| 407 } | 406 } |
| 408 whitelisted = true; | 407 whitelisted = true; |
| 409 } | 408 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 // Some users (such as the download shelf) need to know when a | 561 // Some users (such as the download shelf) need to know when a |
| 563 // CRXInstaller is done. Listening for the EXTENSION_* events | 562 // CRXInstaller is done. Listening for the EXTENSION_* events |
| 564 // is problematic because they don't know anything about the | 563 // is problematic because they don't know anything about the |
| 565 // extension before it is unpacked, so they can not filter based | 564 // extension before it is unpacked, so they can not filter based |
| 566 // on the extension. | 565 // on the extension. |
| 567 NotificationService::current()->Notify( | 566 NotificationService::current()->Notify( |
| 568 NotificationType::CRX_INSTALLER_DONE, | 567 NotificationType::CRX_INSTALLER_DONE, |
| 569 Source<CrxInstaller>(this), | 568 Source<CrxInstaller>(this), |
| 570 NotificationService::NoDetails()); | 569 NotificationService::NoDetails()); |
| 571 } | 570 } |
| OLD | NEW |