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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "net/base/cert_database.h" | 11 #include "net/base/cert_database.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/views/window/dialog_delegate.h" | 13 #include "ui/views/window/dialog_delegate.h" |
14 | 14 |
| 15 class Profile; |
| 16 |
15 namespace chromeos { | 17 namespace chromeos { |
16 | 18 |
17 class EnrollmentDelegate; | 19 class EnrollmentDelegate; |
18 | 20 |
19 // Dialog for certificate enrollment. This displays the content from the | 21 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, |
20 // certificate enrollment URI. | 22 Profile* profile); |
21 class EnrollmentDialogView | |
22 : public views::DialogDelegateView, | |
23 public net::CertDatabase::Observer { | |
24 public: | |
25 virtual ~EnrollmentDialogView(); | |
26 | |
27 static EnrollmentDelegate* CreateEnrollmentDelegate( | |
28 gfx::NativeWindow owning_window); | |
29 | |
30 static void ShowDialog(gfx::NativeWindow owning_window, | |
31 const GURL& target_uri, | |
32 const base::Closure& connect); | |
33 void Close(); | |
34 | |
35 // views::DialogDelegateView overrides | |
36 virtual int GetDialogButtons() const OVERRIDE; | |
37 virtual void OnClose() OVERRIDE; | |
38 | |
39 // views::WidgetDelegate overrides | |
40 virtual ui::ModalType GetModalType() const OVERRIDE; | |
41 virtual string16 GetWindowTitle() const OVERRIDE; | |
42 | |
43 // views::View overrides | |
44 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
45 | |
46 // views::Widget overrides | |
47 virtual views::View* GetContentsView() OVERRIDE; | |
48 | |
49 // net::CertDatabase::Observer overrides | |
50 virtual void OnUserCertAdded(const net::X509Certificate* cert) OVERRIDE; | |
51 | |
52 private: | |
53 EnrollmentDialogView(const GURL& target_uri, | |
54 const base::Closure& connect); | |
55 void InitDialog(); | |
56 | |
57 GURL target_uri_; | |
58 base::Closure connect_; | |
59 bool added_cert_; | |
60 }; | |
61 | 23 |
62 } // namespace chromeos | 24 } // namespace chromeos |
63 | 25 |
64 #endif // CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ | 26 #endif // CHROME_BROWSER_CHROMEOS_ENROLLMENT_DIALOG_VIEW_H_ |
OLD | NEW |