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_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "chrome/browser/cancelable_request.h" | 13 #include "chrome/browser/cancelable_request.h" |
14 #include "chrome/browser/certificate_manager_model.h" | 14 #include "chrome/browser/certificate_manager_model.h" |
15 #include "chrome/browser/ui/select_file_dialog.h" | |
16 #include "chrome/browser/ui/webui/options2/options_ui.h" | 15 #include "chrome/browser/ui/webui/options2/options_ui.h" |
17 #include "net/base/cert_database.h" | 16 #include "net/base/cert_database.h" |
| 17 #include "ui/base/dialogs/select_file_dialog.h" |
18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
19 | 19 |
20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
21 #include "chromeos/dbus/cryptohome_client.h" | 21 #include "chromeos/dbus/cryptohome_client.h" |
22 #endif | 22 #endif |
23 | 23 |
24 namespace options2 { | 24 namespace options2 { |
25 | 25 |
26 class CertIdMap; | 26 class CertIdMap; |
27 class FileAccessProvider; | 27 class FileAccessProvider; |
28 | 28 |
29 class CertificateManagerHandler : public OptionsPageUIHandler, | 29 class CertificateManagerHandler |
30 public CertificateManagerModel::Observer, | 30 : public OptionsPageUIHandler, |
31 public SelectFileDialog::Listener { | 31 public CertificateManagerModel::Observer, |
| 32 public ui::SelectFileDialog::Listener { |
32 public: | 33 public: |
33 CertificateManagerHandler(); | 34 CertificateManagerHandler(); |
34 virtual ~CertificateManagerHandler(); | 35 virtual ~CertificateManagerHandler(); |
35 | 36 |
36 // OptionsPageUIHandler implementation. | 37 // OptionsPageUIHandler implementation. |
37 virtual void GetLocalizedValues( | 38 virtual void GetLocalizedValues( |
38 base::DictionaryValue* localized_strings) OVERRIDE; | 39 base::DictionaryValue* localized_strings) OVERRIDE; |
39 virtual void RegisterMessages() OVERRIDE; | 40 virtual void RegisterMessages() OVERRIDE; |
40 | 41 |
41 // CertificateManagerModel::Observer implementation. | 42 // CertificateManagerModel::Observer implementation. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 scoped_ptr<CertificateManagerModel> certificate_manager_model_; | 162 scoped_ptr<CertificateManagerModel> certificate_manager_model_; |
162 | 163 |
163 // For multi-step import or export processes, we need to store the path, | 164 // For multi-step import or export processes, we need to store the path, |
164 // password, etc the user chose while we wait for them to enter a password, | 165 // password, etc the user chose while we wait for them to enter a password, |
165 // wait for file to be read, etc. | 166 // wait for file to be read, etc. |
166 FilePath file_path_; | 167 FilePath file_path_; |
167 string16 password_; | 168 string16 password_; |
168 bool use_hardware_backed_; | 169 bool use_hardware_backed_; |
169 std::string file_data_; | 170 std::string file_data_; |
170 net::CertificateList selected_cert_list_; | 171 net::CertificateList selected_cert_list_; |
171 scoped_refptr<SelectFileDialog> select_file_dialog_; | 172 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
172 scoped_refptr<net::CryptoModule> module_; | 173 scoped_refptr<net::CryptoModule> module_; |
173 | 174 |
174 // Used in reading and writing certificate files. | 175 // Used in reading and writing certificate files. |
175 CancelableRequestConsumer consumer_; | 176 CancelableRequestConsumer consumer_; |
176 scoped_refptr<FileAccessProvider> file_access_provider_; | 177 scoped_refptr<FileAccessProvider> file_access_provider_; |
177 | 178 |
178 base::WeakPtrFactory<CertificateManagerHandler> weak_ptr_factory_; | 179 base::WeakPtrFactory<CertificateManagerHandler> weak_ptr_factory_; |
179 | 180 |
180 scoped_ptr<CertIdMap> cert_id_map_; | 181 scoped_ptr<CertIdMap> cert_id_map_; |
181 | 182 |
182 DISALLOW_COPY_AND_ASSIGN(CertificateManagerHandler); | 183 DISALLOW_COPY_AND_ASSIGN(CertificateManagerHandler); |
183 }; | 184 }; |
184 | 185 |
185 } // namespace options2 | 186 } // namespace options2 |
186 | 187 |
187 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ | 188 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CERTIFICATE_MANAGER_HANDLER_H_ |
OLD | NEW |