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_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 10 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
11 #include "chrome/browser/extensions/pack_extension_job.h" | 11 #include "chrome/browser/extensions/pack_extension_job.h" |
12 #include "chrome/browser/plugin_data_remover_helper.h" | 12 #include "chrome/browser/plugin_data_remover_helper.h" |
13 #include "content/public/browser/web_ui_message_handler.h" | 13 #include "content/public/browser/web_ui_message_handler.h" |
14 #include "ui/base/dialogs/select_file_dialog.h" | 14 #include "ui/base/dialogs/select_file_dialog.h" |
15 | 15 |
16 // Clear browser data handler page UI handler. | 16 // Clear browser data handler page UI handler. |
17 class PackExtensionHandler : public content::WebUIMessageHandler, | 17 class PackExtensionHandler : public content::WebUIMessageHandler, |
18 public ui::SelectFileDialog::Listener, | 18 public ui::SelectFileDialog::Listener, |
19 public PackExtensionJob::Client { | 19 public extensions::PackExtensionJob::Client { |
20 public: | 20 public: |
21 PackExtensionHandler(); | 21 PackExtensionHandler(); |
22 virtual ~PackExtensionHandler(); | 22 virtual ~PackExtensionHandler(); |
23 | 23 |
24 void GetLocalizedValues(DictionaryValue* localized_strings); | 24 void GetLocalizedValues(DictionaryValue* localized_strings); |
25 | 25 |
26 // WebUIMessageHandler implementation. | 26 // WebUIMessageHandler implementation. |
27 virtual void RegisterMessages() OVERRIDE; | 27 virtual void RegisterMessages() OVERRIDE; |
28 | 28 |
29 // ExtensionPackJob::Client implementation. | 29 // ExtensionPackJob::Client implementation. |
(...skipping 18 matching lines...) Expand all Loading... |
48 // |args[0]| must be a string that specifies the file dialog type: file or | 48 // |args[0]| must be a string that specifies the file dialog type: file or |
49 // folder. | 49 // folder. |
50 // |args[1]| must be a string that specifies the operation to perform: load | 50 // |args[1]| must be a string that specifies the operation to perform: load |
51 // or pem. | 51 // or pem. |
52 void HandleSelectFilePathMessage(const ListValue* args); | 52 void HandleSelectFilePathMessage(const ListValue* args); |
53 | 53 |
54 // A function to ask the page to show an alert. | 54 // A function to ask the page to show an alert. |
55 void ShowAlert(const std::string& message); | 55 void ShowAlert(const std::string& message); |
56 | 56 |
57 // Used to package the extension. | 57 // Used to package the extension. |
58 scoped_refptr<PackExtensionJob> pack_job_; | 58 scoped_refptr<extensions::PackExtensionJob> pack_job_; |
59 | 59 |
60 // Returned by the SelectFileDialog machinery. Used to initiate the selection | 60 // Returned by the SelectFileDialog machinery. Used to initiate the selection |
61 // dialog. | 61 // dialog. |
62 scoped_refptr<ui::SelectFileDialog> load_extension_dialog_; | 62 scoped_refptr<ui::SelectFileDialog> load_extension_dialog_; |
63 | 63 |
64 // Path to root directory of extension | 64 // Path to root directory of extension |
65 std::string extension_path_; | 65 std::string extension_path_; |
66 | 66 |
67 // Path to private key file, or null if none specified | 67 // Path to private key file, or null if none specified |
68 std::string private_key_path_; | 68 std::string private_key_path_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(PackExtensionHandler); | 70 DISALLOW_COPY_AND_ASSIGN(PackExtensionHandler); |
71 }; | 71 }; |
72 | 72 |
73 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ | 73 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_PACK_EXTENSION_HANDLER_H_ |
OLD | NEW |