| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 const std::string& id, | 77 const std::string& id, |
| 78 InstallHelperResultCode result_code, | 78 InstallHelperResultCode result_code, |
| 79 const std::string& error_message) OVERRIDE; | 79 const std::string& error_message) OVERRIDE; |
| 80 | 80 |
| 81 // Implementing ExtensionInstallUI::Delegate interface. | 81 // Implementing ExtensionInstallUI::Delegate interface. |
| 82 virtual void InstallUIProceed() OVERRIDE; | 82 virtual void InstallUIProceed() OVERRIDE; |
| 83 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 83 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 virtual ~BeginInstallWithManifestFunction(); | 86 virtual ~BeginInstallWithManifestFunction(); |
| 87 virtual bool RunImpl(); | 87 virtual bool RunImpl() OVERRIDE; |
| 88 | 88 |
| 89 // Sets the result_ as a string based on |code|. | 89 // Sets the result_ as a string based on |code|. |
| 90 void SetResult(ResultCode code); | 90 void SetResult(ResultCode code); |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 // These store the input parameters to the function. | 93 // These store the input parameters to the function. |
| 94 std::string id_; | 94 std::string id_; |
| 95 std::string manifest_; | 95 std::string manifest_; |
| 96 std::string icon_data_; | 96 std::string icon_data_; |
| 97 std::string localized_name_; | 97 std::string localized_name_; |
| 98 bool use_app_installed_bubble_; | 98 bool use_app_installed_bubble_; |
| 99 | 99 |
| 100 // The results of parsing manifest_ and icon_data_ go into these two. | 100 // The results of parsing manifest_ and icon_data_ go into these two. |
| 101 scoped_ptr<base::DictionaryValue> parsed_manifest_; | 101 scoped_ptr<base::DictionaryValue> parsed_manifest_; |
| 102 SkBitmap icon_; | 102 SkBitmap icon_; |
| 103 | 103 |
| 104 // A dummy Extension object we create for the purposes of using | 104 // A dummy Extension object we create for the purposes of using |
| 105 // ExtensionInstallUI to prompt for confirmation of the install. | 105 // ExtensionInstallUI to prompt for confirmation of the install. |
| 106 scoped_refptr<Extension> dummy_extension_; | 106 scoped_refptr<Extension> dummy_extension_; |
| 107 | 107 |
| 108 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.beginInstallWithManifest3"); | 108 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.beginInstallWithManifest3"); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 class CompleteInstallFunction : public SyncExtensionFunction { | 111 class CompleteInstallFunction : public SyncExtensionFunction { |
| 112 virtual bool RunImpl(); | 112 virtual bool RunImpl() OVERRIDE; |
| 113 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.completeInstall"); | 113 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.completeInstall"); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 class SilentlyInstallFunction : public AsyncExtensionFunction, | 116 class SilentlyInstallFunction : public AsyncExtensionFunction, |
| 117 public WebstoreInstallHelper::Delegate, | 117 public WebstoreInstallHelper::Delegate, |
| 118 public WebstoreInstaller::Delegate { | 118 public WebstoreInstaller::Delegate { |
| 119 public: | 119 public: |
| 120 SilentlyInstallFunction(); | 120 SilentlyInstallFunction(); |
| 121 | 121 |
| 122 // WebstoreInstallHelper::Delegate implementation. | 122 // WebstoreInstallHelper::Delegate implementation. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 138 virtual ~SilentlyInstallFunction(); | 138 virtual ~SilentlyInstallFunction(); |
| 139 virtual bool RunImpl() OVERRIDE; | 139 virtual bool RunImpl() OVERRIDE; |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 std::string id_; | 142 std::string id_; |
| 143 std::string manifest_; | 143 std::string manifest_; |
| 144 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.silentlyInstall"); | 144 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.silentlyInstall"); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 class GetBrowserLoginFunction : public SyncExtensionFunction { | 147 class GetBrowserLoginFunction : public SyncExtensionFunction { |
| 148 virtual bool RunImpl(); | 148 virtual bool RunImpl() OVERRIDE; |
| 149 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin"); | 149 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin"); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 class GetStoreLoginFunction : public SyncExtensionFunction { | 152 class GetStoreLoginFunction : public SyncExtensionFunction { |
| 153 virtual bool RunImpl(); | 153 virtual bool RunImpl() OVERRIDE; |
| 154 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); | 154 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin"); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 class SetStoreLoginFunction : public SyncExtensionFunction { | 157 class SetStoreLoginFunction : public SyncExtensionFunction { |
| 158 virtual bool RunImpl(); | 158 virtual bool RunImpl() OVERRIDE; |
| 159 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin"); | 159 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin"); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 162 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
| OLD | NEW |