OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INSTALLER_UTIL_HTML_DIALOG_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_HTML_DIALOG_H_ |
6 #define CHROME_INSTALLER_UTIL_HTML_DIALOG_H_ | 6 #define CHROME_INSTALLER_UTIL_HTML_DIALOG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 // different underlying implementation according to the url protocol. | 63 // different underlying implementation according to the url protocol. |
64 HTMLDialog* CreateNativeHTMLDialog(const std::wstring& url); | 64 HTMLDialog* CreateNativeHTMLDialog(const std::wstring& url); |
65 | 65 |
66 // This class leverages HTMLDialog to create a dialog that is suitable | 66 // This class leverages HTMLDialog to create a dialog that is suitable |
67 // for a end-user-agreement modal dialog. The html shows a fairly standard | 67 // for a end-user-agreement modal dialog. The html shows a fairly standard |
68 // EULA form with the accept and cancel buttons and an optional check box | 68 // EULA form with the accept and cancel buttons and an optional check box |
69 // to opt-in for sending usage stats and crash reports. | 69 // to opt-in for sending usage stats and crash reports. |
70 class EulaHTMLDialog { | 70 class EulaHTMLDialog { |
71 public: | 71 public: |
72 // |file| points to an html file on disk or to a resource via res:// spec. | 72 // |file| points to an html file on disk or to a resource via res:// spec. |
73 explicit EulaHTMLDialog(const std::wstring& file); | 73 explicit EulaHTMLDialog(const std::wstring& file, |
grt (UTC plus 2)
2011/07/04 18:42:04
please remove "explicit" since this is no longer a
robertshield
2011/07/04 19:12:31
Done.
| |
74 const std::wstring& param); | |
74 ~EulaHTMLDialog(); | 75 ~EulaHTMLDialog(); |
75 | 76 |
76 enum Outcome { | 77 enum Outcome { |
77 REJECTED, // Declined EULA, mapped from HTML_DLG_ACCEPT (1). | 78 REJECTED, // Declined EULA, mapped from HTML_DLG_ACCEPT (1). |
78 ACCEPTED, // Accepted EULA no opt-in, from HTML_DLG_DECLINE (2). | 79 ACCEPTED, // Accepted EULA no opt-in, from HTML_DLG_DECLINE (2). |
79 ACCEPTED_OPT_IN, // Accepted EULA and opt-in, from HTML_DLG_EXTRA (6). | 80 ACCEPTED_OPT_IN, // Accepted EULA and opt-in, from HTML_DLG_EXTRA (6). |
80 }; | 81 }; |
81 | 82 |
82 // Shows the dialog and blocks for user input. The return value is one of | 83 // Shows the dialog and blocks for user input. The return value is one of |
83 // the |Outcome| values and any form of failure maps to REJECTED. | 84 // the |Outcome| values and any form of failure maps to REJECTED. |
84 Outcome ShowModal(); | 85 Outcome ShowModal(); |
85 | 86 |
86 private: | 87 private: |
87 class Customizer : public HTMLDialog::CustomizationCallback { | 88 class Customizer : public HTMLDialog::CustomizationCallback { |
88 public: | 89 public: |
89 virtual void OnBeforeCreation(void** extra); | 90 virtual void OnBeforeCreation(void** extra); |
90 virtual void OnBeforeDisplay(void* window); | 91 virtual void OnBeforeDisplay(void* window); |
91 }; | 92 }; |
92 | 93 |
93 HTMLDialog* dialog_; | 94 HTMLDialog* dialog_; |
94 DISALLOW_COPY_AND_ASSIGN(EulaHTMLDialog); | 95 DISALLOW_COPY_AND_ASSIGN(EulaHTMLDialog); |
95 }; | 96 }; |
96 | 97 |
97 } // namespace installer | 98 } // namespace installer |
98 | 99 |
99 #endif // CHROME_INSTALLER_UTIL_HTML_DIALOG_H_ | 100 #endif // CHROME_INSTALLER_UTIL_HTML_DIALOG_H_ |
OLD | NEW |