OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_PACK_EXTENSION_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_PACK_EXTENSION_HANDLER_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "chrome/browser/browsing_data_remover.h" | |
12 #include "chrome/browser/extensions/pack_extension_job.h" | |
13 #include "chrome/browser/plugin_data_remover_helper.h" | |
14 #include "chrome/browser/ui/webui/options2/options_ui.h" | |
15 | |
16 // Clear browser data handler page UI handler. | |
17 class PackExtensionHandler : public OptionsPage2UIHandler, | |
18 public PackExtensionJob::Client { | |
19 public: | |
20 PackExtensionHandler(); | |
21 virtual ~PackExtensionHandler(); | |
22 | |
23 // OptionsPage2UIHandler implementation. | |
24 virtual void Initialize() OVERRIDE; | |
25 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | |
26 | |
27 // WebUIMessageHandler implementation. | |
28 virtual void RegisterMessages() OVERRIDE; | |
29 | |
30 // ExtensionPackJob::Client | |
31 virtual void OnPackSuccess(const FilePath& crx_file, | |
32 const FilePath& key_file) OVERRIDE; | |
33 | |
34 virtual void OnPackFailure(const std::string& error) OVERRIDE; | |
35 | |
36 private: | |
37 // Javascript callback to start packing an extension. | |
38 void HandlePackMessage(const ListValue* args); | |
39 | |
40 // A function to ask the webpage to show an alert. | |
41 void ShowAlert(const std::string& message); | |
42 | |
43 // Used to package the extension. | |
44 scoped_refptr<PackExtensionJob> pack_job_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(PackExtensionHandler); | |
47 }; | |
48 | |
49 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_PACK_EXTENSION_HANDLER_H_ | |
OLD | NEW |