| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 ->IsExtensionBlacklisted(extension_->id())) { | 343 ->IsExtensionBlacklisted(extension_->id())) { |
| 344 VLOG(1) << "This extension: " << extension_->id() | 344 VLOG(1) << "This extension: " << extension_->id() |
| 345 << " is blacklisted. Install failed."; | 345 << " is blacklisted. Install failed."; |
| 346 ReportFailureFromUIThread( | 346 ReportFailureFromUIThread( |
| 347 l10n_util::GetStringUTF16(IDS_EXTENSION_CANT_INSTALL_BLACKLISTED)); | 347 l10n_util::GetStringUTF16(IDS_EXTENSION_CANT_INSTALL_BLACKLISTED)); |
| 348 return; | 348 return; |
| 349 } | 349 } |
| 350 | 350 |
| 351 if (!frontend_weak_->extension_prefs()->IsExtensionAllowedByPolicy( | 351 if (!frontend_weak_->extension_prefs()->IsExtensionAllowedByPolicy( |
| 352 extension_->id(), install_source_)) { | 352 extension_->id(), install_source_)) { |
| 353 ReportFailureFromUIThread( | 353 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( |
| 354 l10n_util::GetStringUTF16(IDS_EXTENSION_CANT_INSTALL_POLICY_BLACKLIST)); | 354 IDS_EXTENSION_CANT_INSTALL_POLICY_BLACKLIST, |
| 355 UTF8ToUTF16(extension_->name()), |
| 356 UTF8ToUTF16(extension_->id()))); |
| 355 return; | 357 return; |
| 356 } | 358 } |
| 357 | 359 |
| 358 GURL overlapping_url; | 360 GURL overlapping_url; |
| 359 const Extension* overlapping_extension = | 361 const Extension* overlapping_extension = |
| 360 frontend_weak_->extensions()-> | 362 frontend_weak_->extensions()-> |
| 361 GetHostedAppByOverlappingWebExtent(extension_->web_extent()); | 363 GetHostedAppByOverlappingWebExtent(extension_->web_extent()); |
| 362 if (overlapping_extension && | 364 if (overlapping_extension && |
| 363 overlapping_extension->id() != extension_->id()) { | 365 overlapping_extension->id() != extension_->id()) { |
| 364 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( | 366 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 // Some users (such as the download shelf) need to know when a | 552 // Some users (such as the download shelf) need to know when a |
| 551 // CRXInstaller is done. Listening for the EXTENSION_* events | 553 // CRXInstaller is done. Listening for the EXTENSION_* events |
| 552 // is problematic because they don't know anything about the | 554 // is problematic because they don't know anything about the |
| 553 // extension before it is unpacked, so they cannot filter based | 555 // extension before it is unpacked, so they cannot filter based |
| 554 // on the extension. | 556 // on the extension. |
| 555 content::NotificationService::current()->Notify( | 557 content::NotificationService::current()->Notify( |
| 556 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 558 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 557 content::Source<CrxInstaller>(this), | 559 content::Source<CrxInstaller>(this), |
| 558 content::Details<const Extension>(extension)); | 560 content::Details<const Extension>(extension)); |
| 559 } | 561 } |
| OLD | NEW |