OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" | 11 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
13 #include "ui/views/controls/styled_label_listener.h" | 13 #include "ui/views/controls/styled_label_listener.h" |
14 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class WebContents; | 17 class WebContents; |
18 } | 18 } |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 namespace attestation { | 21 namespace attestation { |
22 | 22 |
23 // A tab-modal dialog UI to ask the user for PlatformVerificationFlow. | 23 // A tab-modal dialog UI to ask the user for PlatformVerificationFlow. |
24 class PlatformVerificationDialog : public views::DialogDelegateView, | 24 class PlatformVerificationDialog : public views::DialogDelegateView, |
25 public views::StyledLabelListener, | 25 public views::StyledLabelListener, |
26 public content::WebContentsObserver { | 26 public content::WebContentsObserver { |
27 public: | 27 public: |
28 // Initializes a tab-modal dialog for |web_contents| and shows it. | 28 // Initializes a tab-modal dialog for |web_contents| and |requesting_origin| |
29 static void ShowDialog( | 29 // and shows it. Returns a non-owning pointer to the widget so that caller can |
| 30 // close the dialog and cancel the request. The returned widget is only |
| 31 // guaranteed to be valid before |callback| is called. |
| 32 static views::Widget* ShowDialog( |
30 content::WebContents* web_contents, | 33 content::WebContents* web_contents, |
| 34 const GURL& requesting_origin, |
31 const PlatformVerificationFlow::Delegate::ConsentCallback& callback); | 35 const PlatformVerificationFlow::Delegate::ConsentCallback& callback); |
32 | 36 |
33 protected: | 37 protected: |
34 ~PlatformVerificationDialog() override; | 38 ~PlatformVerificationDialog() override; |
35 | 39 |
36 private: | 40 private: |
37 PlatformVerificationDialog( | 41 PlatformVerificationDialog( |
38 content::WebContents* web_contents, | 42 content::WebContents* web_contents, |
39 const base::string16& domain, | 43 const base::string16& domain, |
40 const PlatformVerificationFlow::Delegate::ConsentCallback& callback); | 44 const PlatformVerificationFlow::Delegate::ConsentCallback& callback); |
(...skipping 22 matching lines...) Expand all Loading... |
63 base::string16 domain_; | 67 base::string16 domain_; |
64 PlatformVerificationFlow::Delegate::ConsentCallback callback_; | 68 PlatformVerificationFlow::Delegate::ConsentCallback callback_; |
65 | 69 |
66 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationDialog); | 70 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationDialog); |
67 }; | 71 }; |
68 | 72 |
69 } // namespace attestation | 73 } // namespace attestation |
70 } // namespace chromeos | 74 } // namespace chromeos |
71 | 75 |
72 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ | 76 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_ |
OLD | NEW |