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_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
| 11 #include "base/callback_forward.h" |
10 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
11 | 13 |
12 class Profile; | 14 class Profile; |
13 | 15 |
14 namespace chromeos { | 16 namespace chromeos { |
15 | 17 |
16 class EnrollmentDelegate; | 18 // An interface that can be used to handle certificate enrollment URIs when |
| 19 // encountered. Also used by unit tests to avoid opening browser windows |
| 20 // when testing. |
| 21 class EnrollmentDelegate { |
| 22 public: |
| 23 EnrollmentDelegate() {} |
| 24 virtual ~EnrollmentDelegate() {} |
| 25 |
| 26 // Implemented to handle a given certificate enrollment URI. Returns false |
| 27 // if the enrollment URI doesn't use a scheme that we can handle. |
| 28 // |post_action| is called when enrollment completes. |
| 29 virtual bool Enroll(const std::vector<std::string>& uri_list, |
| 30 const base::Closure& post_action) = 0; |
| 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(EnrollmentDelegate); |
| 33 }; |
17 | 34 |
18 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, | 35 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, |
19 const std::string& network_name, | 36 const std::string& network_name, |
20 Profile* profile); | 37 Profile* profile); |
21 | 38 |
22 } // namespace chromeos | 39 } // namespace chromeos |
23 | 40 |
24 #endif // CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ |
OLD | NEW |