Chromium Code Reviews| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 341 | 341 |
| 342 if (frontend_weak_->extension_prefs() | 342 if (frontend_weak_->extension_prefs() |
| 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 string16 error; |
| 352 extension_->id(), install_source_)) { | 352 if (!frontend_weak_->extension_management_policy()->UserMayInstall( |
|
Aaron Boodman
2012/05/17 22:41:06
ExtensionSystem should own ManagementPolicy, not E
| |
| 353 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( | 353 extension_->id(), install_source_, extension_->name(), &error)) { |
| 354 IDS_EXTENSION_CANT_INSTALL_POLICY_BLACKLIST, | 354 ReportFailureFromUIThread(error); |
| 355 UTF8ToUTF16(extension_->name()), | |
| 356 UTF8ToUTF16(extension_->id()))); | |
| 357 return; | 355 return; |
| 358 } | 356 } |
| 359 | 357 |
| 360 GURL overlapping_url; | 358 GURL overlapping_url; |
| 361 const Extension* overlapping_extension = | 359 const Extension* overlapping_extension = |
| 362 frontend_weak_->extensions()-> | 360 frontend_weak_->extensions()-> |
| 363 GetHostedAppByOverlappingWebExtent(extension_->web_extent()); | 361 GetHostedAppByOverlappingWebExtent(extension_->web_extent()); |
| 364 if (overlapping_extension && | 362 if (overlapping_extension && |
| 365 overlapping_extension->id() != extension_->id()) { | 363 overlapping_extension->id() != extension_->id()) { |
| 366 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( | 364 ReportFailureFromUIThread(l10n_util::GetStringFUTF16( |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 // Some users (such as the download shelf) need to know when a | 550 // Some users (such as the download shelf) need to know when a |
| 553 // CRXInstaller is done. Listening for the EXTENSION_* events | 551 // CRXInstaller is done. Listening for the EXTENSION_* events |
| 554 // is problematic because they don't know anything about the | 552 // is problematic because they don't know anything about the |
| 555 // extension before it is unpacked, so they cannot filter based | 553 // extension before it is unpacked, so they cannot filter based |
| 556 // on the extension. | 554 // on the extension. |
| 557 content::NotificationService::current()->Notify( | 555 content::NotificationService::current()->Notify( |
| 558 chrome::NOTIFICATION_CRX_INSTALLER_DONE, | 556 chrome::NOTIFICATION_CRX_INSTALLER_DONE, |
| 559 content::Source<CrxInstaller>(this), | 557 content::Source<CrxInstaller>(this), |
| 560 content::Details<const Extension>(extension)); | 558 content::Details<const Extension>(extension)); |
| 561 } | 559 } |
| OLD | NEW |