| 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 #ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // using |client|. Pass NULL for |client| for silent install | 68 // using |client|. Pass NULL for |client| for silent install |
| 69 static scoped_refptr<CrxInstaller> Create( | 69 static scoped_refptr<CrxInstaller> Create( |
| 70 ExtensionService* frontend, | 70 ExtensionService* frontend, |
| 71 ExtensionInstallPrompt* client); | 71 ExtensionInstallPrompt* client); |
| 72 | 72 |
| 73 // Same as the previous method, except use the |approval| to bypass the | 73 // Same as the previous method, except use the |approval| to bypass the |
| 74 // prompt. Note that the caller retains ownership of |approval|. | 74 // prompt. Note that the caller retains ownership of |approval|. |
| 75 static scoped_refptr<CrxInstaller> Create( | 75 static scoped_refptr<CrxInstaller> Create( |
| 76 ExtensionService* frontend, | 76 ExtensionService* frontend, |
| 77 ExtensionInstallPrompt* client, | 77 ExtensionInstallPrompt* client, |
| 78 const WebstoreInstaller::Approval* approval); | 78 const extensions::WebstoreInstaller::Approval* approval); |
| 79 | 79 |
| 80 // Install the crx in |source_file|. | 80 // Install the crx in |source_file|. |
| 81 void InstallCrx(const FilePath& source_file); | 81 void InstallCrx(const FilePath& source_file); |
| 82 | 82 |
| 83 // Convert the specified user script into an extension and install it. | 83 // Convert the specified user script into an extension and install it. |
| 84 void InstallUserScript(const FilePath& source_file, | 84 void InstallUserScript(const FilePath& source_file, |
| 85 const GURL& download_url); | 85 const GURL& download_url); |
| 86 | 86 |
| 87 // Convert the specified web app into an extension and install it. | 87 // Convert the specified web app into an extension and install it. |
| 88 void InstallWebApp(const WebApplicationInfo& web_app); | 88 void InstallWebApp(const WebApplicationInfo& web_app); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 bool did_handle_successfully() const { return did_handle_successfully_; } | 169 bool did_handle_successfully() const { return did_handle_successfully_; } |
| 170 | 170 |
| 171 Profile* profile() { return profile_; } | 171 Profile* profile() { return profile_; } |
| 172 | 172 |
| 173 private: | 173 private: |
| 174 friend class extensions::ExtensionUpdaterTest; | 174 friend class extensions::ExtensionUpdaterTest; |
| 175 friend class ExtensionCrxInstallerTest; | 175 friend class ExtensionCrxInstallerTest; |
| 176 | 176 |
| 177 CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak, | 177 CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak, |
| 178 ExtensionInstallPrompt* client, | 178 ExtensionInstallPrompt* client, |
| 179 const WebstoreInstaller::Approval* approval); | 179 const extensions::WebstoreInstaller::Approval* approval); |
| 180 virtual ~CrxInstaller(); | 180 virtual ~CrxInstaller(); |
| 181 | 181 |
| 182 // Converts the source user script to an extension. | 182 // Converts the source user script to an extension. |
| 183 void ConvertUserScriptOnFileThread(); | 183 void ConvertUserScriptOnFileThread(); |
| 184 | 184 |
| 185 // Converts the source web app to an extension. | 185 // Converts the source web app to an extension. |
| 186 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); | 186 void ConvertWebAppOnFileThread(const WebApplicationInfo& web_app); |
| 187 | 187 |
| 188 // Called after OnUnpackSuccess as a last check to see whether the install | 188 // Called after OnUnpackSuccess as a last check to see whether the install |
| 189 // should complete. | 189 // should complete. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // still consider the installation 'handled'. | 337 // still consider the installation 'handled'. |
| 338 bool did_handle_successfully_; | 338 bool did_handle_successfully_; |
| 339 | 339 |
| 340 // Whether we should record an oauth2 grant upon successful install. | 340 // Whether we should record an oauth2 grant upon successful install. |
| 341 bool record_oauth2_grant_; | 341 bool record_oauth2_grant_; |
| 342 | 342 |
| 343 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); | 343 DISALLOW_COPY_AND_ASSIGN(CrxInstaller); |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ | 346 #endif // CHROME_BROWSER_EXTENSIONS_CRX_INSTALLER_H_ |
| OLD | NEW |