| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 "'import' version requested is newer than what is installed."; | 43 "'import' version requested is newer than what is installed."; |
| 44 const char kImportMissing[] = "'import' extension is not installed."; | 44 const char kImportMissing[] = "'import' extension is not installed."; |
| 45 const char kImportNotSharedModule[] = "'import' is not a shared module."; | 45 const char kImportNotSharedModule[] = "'import' is not a shared module."; |
| 46 | 46 |
| 47 // Manages an ExtensionInstallPrompt for a particular extension. | 47 // Manages an ExtensionInstallPrompt for a particular extension. |
| 48 class SimpleExtensionLoadPrompt : public ExtensionInstallPrompt::Delegate { | 48 class SimpleExtensionLoadPrompt : public ExtensionInstallPrompt::Delegate { |
| 49 public: | 49 public: |
| 50 SimpleExtensionLoadPrompt(const Extension* extension, | 50 SimpleExtensionLoadPrompt(const Extension* extension, |
| 51 Profile* profile, | 51 Profile* profile, |
| 52 const base::Closure& callback); | 52 const base::Closure& callback); |
| 53 virtual ~SimpleExtensionLoadPrompt(); | 53 ~SimpleExtensionLoadPrompt() override; |
| 54 | 54 |
| 55 void ShowPrompt(); | 55 void ShowPrompt(); |
| 56 | 56 |
| 57 // ExtensionInstallUI::Delegate | 57 // ExtensionInstallUI::Delegate |
| 58 virtual void InstallUIProceed() override; | 58 void InstallUIProceed() override; |
| 59 virtual void InstallUIAbort(bool user_initiated) override; | 59 void InstallUIAbort(bool user_initiated) override; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 scoped_ptr<ExtensionInstallPrompt> install_ui_; | 62 scoped_ptr<ExtensionInstallPrompt> install_ui_; |
| 63 scoped_refptr<const Extension> extension_; | 63 scoped_refptr<const Extension> extension_; |
| 64 base::Closure callback_; | 64 base::Closure callback_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( | 67 SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( |
| 68 const Extension* extension, | 68 const Extension* extension, |
| 69 Profile* profile, | 69 Profile* profile, |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 PermissionsUpdater perms_updater(service_weak_->profile()); | 360 PermissionsUpdater perms_updater(service_weak_->profile()); |
| 361 perms_updater.InitializePermissions(extension()); | 361 perms_updater.InitializePermissions(extension()); |
| 362 perms_updater.GrantActivePermissions(extension()); | 362 perms_updater.GrantActivePermissions(extension()); |
| 363 | 363 |
| 364 service_weak_->OnExtensionInstalled( | 364 service_weak_->OnExtensionInstalled( |
| 365 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); | 365 extension(), syncer::StringOrdinal(), kInstallFlagInstallImmediately); |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace extensions | 368 } // namespace extensions |
| OLD | NEW |