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