| 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 "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 const char kUnpackedExtensionsBlacklistedError[] = | 29 const char kUnpackedExtensionsBlacklistedError[] = |
| 30 "Loading of unpacked extensions is disabled by the administrator."; | 30 "Loading of unpacked extensions is disabled by the administrator."; |
| 31 | 31 |
| 32 // Manages an ExtensionInstallPrompt for a particular extension. | 32 // Manages an ExtensionInstallPrompt for a particular extension. |
| 33 class SimpleExtensionLoadPrompt : public ExtensionInstallPrompt::Delegate { | 33 class SimpleExtensionLoadPrompt : public ExtensionInstallPrompt::Delegate { |
| 34 public: | 34 public: |
| 35 SimpleExtensionLoadPrompt(Profile* profile, | 35 SimpleExtensionLoadPrompt(Profile* profile, |
| 36 base::WeakPtr<ExtensionService> extension_service, | 36 base::WeakPtr<ExtensionService> extension_service, |
| 37 const Extension* extension); | 37 const Extension* extension); |
| 38 ~SimpleExtensionLoadPrompt(); | 38 virtual ~SimpleExtensionLoadPrompt(); |
| 39 | 39 |
| 40 void ShowPrompt(); | 40 void ShowPrompt(); |
| 41 | 41 |
| 42 // ExtensionInstallUI::Delegate | 42 // ExtensionInstallUI::Delegate |
| 43 virtual void InstallUIProceed() OVERRIDE; | 43 virtual void InstallUIProceed() OVERRIDE; |
| 44 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 44 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 base::WeakPtr<ExtensionService> service_weak_; | 47 base::WeakPtr<ExtensionService> service_weak_; |
| 48 scoped_ptr<ExtensionInstallPrompt> install_ui_; | 48 scoped_ptr<ExtensionInstallPrompt> install_ui_; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 PermissionsUpdater perms_updater(service_weak_->profile()); | 265 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 266 perms_updater.GrantActivePermissions(extension_, false); | 266 perms_updater.GrantActivePermissions(extension_, false); |
| 267 service_weak_->OnExtensionInstalled(extension_, | 267 service_weak_->OnExtensionInstalled(extension_, |
| 268 syncer::StringOrdinal(), | 268 syncer::StringOrdinal(), |
| 269 false /* no requirement errors */, | 269 false /* no requirement errors */, |
| 270 false /* don't wait for idle */); | 270 false /* don't wait for idle */); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace extensions | 273 } // namespace extensions |
| OLD | NEW |