OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_FEEDBACK_DIALOG_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_FEEDBACK_DIALOG_VIEW_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "chrome/browser/ui/browser.h" | |
mattm
2014/02/07 02:03:36
unused?
felt
2014/02/07 05:27:50
Done.
| |
11 #include "chrome/common/pref_names.h" | |
12 #include "ui/views/window/dialog_delegate.h" | |
13 | |
14 namespace views { | |
15 class MessageBoxView; | |
16 } | |
17 | |
18 class Profile; | |
19 | |
20 // Asks the user whether s/he wants to participate in the Safe Browsing | |
21 // download feedback program. Shown only for downloads marked DANGEROUS_HOST | |
22 // or UNCOMMON_DOWNLOAD. The user should only see this dialog once. | |
23 class DownloadFeedbackDialogView : public views::DialogDelegate { | |
24 public: | |
25 // Possible values for prefs::kSafeBrowsingDownloadReportingEnabled pref. | |
26 enum DownloadReportingStatus { | |
27 kDialogNotYetShown, | |
28 kDownloadReportingDisabled, // Set by Cancel(). | |
29 kDownloadReportingEnabled, // Set by Accept(). | |
30 kMaxValue | |
31 }; | |
32 | |
33 static void Show( | |
34 gfx::NativeWindow parent_window, | |
35 Profile* profile, | |
36 const base::Callback<void(DownloadReportingStatus)>& callback); | |
37 | |
38 private: | |
39 DownloadFeedbackDialogView( | |
40 Profile* profile, | |
41 const base::Callback<void(DownloadReportingStatus)>& callback); | |
42 virtual ~DownloadFeedbackDialogView(); | |
43 | |
44 void ReleaseDialogStatusHold(); | |
45 | |
46 // views::DialogDelegate: | |
47 virtual ui::ModalType GetModalType() const OVERRIDE; | |
48 virtual base::string16 GetWindowTitle() const OVERRIDE; | |
49 virtual void DeleteDelegate() OVERRIDE; | |
50 virtual views::Widget* GetWidget() OVERRIDE; | |
51 virtual const views::Widget* GetWidget() const OVERRIDE; | |
52 virtual views::View* GetContentsView() OVERRIDE; | |
53 virtual int GetDefaultDialogButton() const OVERRIDE; | |
54 virtual base::string16 GetDialogButtonLabel( | |
55 ui::DialogButton button) const OVERRIDE; | |
56 virtual bool Cancel() OVERRIDE; | |
57 virtual bool Accept() OVERRIDE; | |
58 | |
59 Profile* profile_; | |
60 const base::Callback<void(DownloadReportingStatus)> callback_; | |
61 views::MessageBoxView* explanation_box_view_; | |
62 base::string16 title_text_; | |
63 base::string16 ok_button_text_; | |
64 base::string16 cancel_button_text_; | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(DownloadFeedbackDialogView); | |
67 }; | |
68 | |
69 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_FEEDBACK_DIALOG_VIEW_H_ | |
OLD | NEW |