| 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/unpacked_installer.h" | 5 #include "chrome/browser/extensions/unpacked_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "chrome/browser/extensions/extension_install_ui.h" | 10 #include "chrome/browser/extensions/extension_install_ui.h" |
| 11 #include "chrome/browser/extensions/extension_prefs.h" | 11 #include "chrome/browser/extensions/extension_prefs.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/permissions_updater.h" | 13 #include "chrome/browser/extensions/permissions_updater.h" |
| 14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 15 #include "chrome/common/extensions/extension_file_util.h" | 15 #include "chrome/common/extensions/extension_file_util.h" |
| 16 #include "chrome/common/string_ordinal.h" | 16 #include "chrome/common/string_ordinal.h" |
| 17 | 17 |
| 18 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 using extensions::Extension; |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 const char kUnpackedExtensionsBlacklistedError[] = | 23 const char kUnpackedExtensionsBlacklistedError[] = |
| 23 "Loading of unpacked extensions is disabled by the administrator."; | 24 "Loading of unpacked extensions is disabled by the administrator."; |
| 24 | 25 |
| 25 // Manages an ExtensionInstallUI for a particular extension. | 26 // Manages an ExtensionInstallUI for a particular extension. |
| 26 class SimpleExtensionLoadPrompt : public ExtensionInstallUI::Delegate { | 27 class SimpleExtensionLoadPrompt : public ExtensionInstallUI::Delegate { |
| 27 public: | 28 public: |
| 28 SimpleExtensionLoadPrompt(Profile* profile, | 29 SimpleExtensionLoadPrompt(Profile* profile, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 239 } |
| 239 | 240 |
| 240 PermissionsUpdater perms_updater(service_weak_->profile()); | 241 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 241 perms_updater.GrantActivePermissions(extension); | 242 perms_updater.GrantActivePermissions(extension); |
| 242 service_weak_->OnExtensionInstalled(extension, | 243 service_weak_->OnExtensionInstalled(extension, |
| 243 false, // Not from web store. | 244 false, // Not from web store. |
| 244 StringOrdinal()); | 245 StringOrdinal()); |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace extensions | 248 } // namespace extensions |
| OLD | NEW |