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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_
6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/strings/string16.h"
11 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h"
12 #include "ui/views/controls/styled_label_listener.h"
13 #include "ui/views/window/dialog_delegate.h"
20 namespace attestation
{
22 // A tab-modal dialog UI to ask the user for PlatformVerificationFlow.
23 class PlatformVerificationDialog
: public views::DialogDelegateView
,
24 public views::StyledLabelListener
{
26 // Initializes a tab-modal dialog for |web_contents| and shows it.
27 static void ShowDialog(
28 content::WebContents
* web_contents
,
29 const PlatformVerificationFlow::Delegate::ConsentCallback
& callback
);
32 virtual ~PlatformVerificationDialog();
35 PlatformVerificationDialog(
36 content::WebContents
* web_contents
,
37 const base::string16
& domain
,
38 const PlatformVerificationFlow::Delegate::ConsentCallback
& callback
);
40 // Overridden from views::DialogDelegate:
41 virtual bool Cancel() OVERRIDE
;
42 virtual bool Accept() OVERRIDE
;
43 virtual bool Close() OVERRIDE
;
44 virtual base::string16
GetDialogButtonLabel(
45 ui::DialogButton button
) const OVERRIDE
;
47 // Overridden from views::WidgetDelegate:
48 virtual ui::ModalType
GetModalType() const OVERRIDE
;
50 // Overridden from views::View:
51 virtual gfx::Size
GetPreferredSize() OVERRIDE
;
53 // Overridden from views::StyledLabelListener:
54 virtual void StyledLabelLinkClicked(const gfx::Range
& range
,
55 int event_flags
) OVERRIDE
;
57 content::WebContents
* web_contents_
;
58 base::string16 domain_
;
59 PlatformVerificationFlow::Delegate::ConsentCallback callback_
;
61 DISALLOW_COPY_AND_ASSIGN(PlatformVerificationDialog
);
64 } // namespace attestation
65 } // namespace chromeos
67 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_DIALOG_H_