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_EXTENSIONS_STARTUP_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "chrome/browser/extensions/pack_extension_job.h" | 10 #include "chrome/browser/extensions/pack_extension_job.h" |
11 | 11 |
12 class CommandLine; | 12 class CommandLine; |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 // Initialization helpers for various Extension startup actions. | 15 // Initialization helpers for various Extension startup actions. |
16 class ExtensionsStartupUtil : public PackExtensionJob::Client { | 16 class ExtensionsStartupUtil : public PackExtensionJob::Client { |
17 public: | 17 public: |
18 ExtensionsStartupUtil(); | 18 ExtensionsStartupUtil(); |
19 virtual ~ExtensionsStartupUtil(); | 19 virtual ~ExtensionsStartupUtil(); |
20 | 20 |
21 virtual void OnPackSuccess(const FilePath& crx_path, | 21 virtual void OnPackSuccess(const FilePath& crx_path, |
22 const FilePath& output_private_key_path) OVERRIDE; | 22 const FilePath& output_private_key_path) OVERRIDE; |
23 virtual void OnPackFailure(const std::string& error_message, | 23 virtual void OnPackFailure( |
24 ExtensionCreator::ErrorType type) OVERRIDE; | 24 const std::string& error_message, |
| 25 extensions::ExtensionCreator::ErrorType type) OVERRIDE; |
25 | 26 |
26 // Handle --pack-extension flag from the |cmd_line| by packing the specified | 27 // Handle --pack-extension flag from the |cmd_line| by packing the specified |
27 // extension. Returns false if the pack job failed. | 28 // extension. Returns false if the pack job failed. |
28 bool PackExtension(const CommandLine& cmd_line); | 29 bool PackExtension(const CommandLine& cmd_line); |
29 | 30 |
30 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the | 31 // Handle --uninstall-extension flag from the |cmd_line| by uninstalling the |
31 // specified extension from |profile|. Returns false if the uninstall job | 32 // specified extension from |profile|. Returns false if the uninstall job |
32 // could not be started. | 33 // could not be started. |
33 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); | 34 bool UninstallExtension(const CommandLine& cmd_line, Profile* profile); |
34 | 35 |
35 private: | 36 private: |
36 scoped_refptr<PackExtensionJob> pack_job_; | 37 scoped_refptr<PackExtensionJob> pack_job_; |
37 bool pack_job_succeeded_; | 38 bool pack_job_succeeded_; |
38 | 39 |
39 DISALLOW_COPY_AND_ASSIGN(ExtensionsStartupUtil); | 40 DISALLOW_COPY_AND_ASSIGN(ExtensionsStartupUtil); |
40 }; | 41 }; |
41 | 42 |
42 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_ | 43 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_STARTUP_H_ |
OLD | NEW |