OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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_SRT_PROMPT_DIALOG_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_SRT_PROMPT_DIALOG_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "third_party/skia/include/core/SkColor.h" | |
10 #include "ui/gfx/image/image_skia.h" | |
11 #include "ui/views/controls/button/button.h" | |
12 #include "ui/views/controls/button/label_button.h" | |
13 #include "ui/views/window/dialog_delegate.h" | |
14 | |
15 class Browser; | |
16 | |
17 namespace safe_browsing { | |
18 class SRTPromptController; | |
19 } | |
20 | |
21 // A modal dialog asking the user if they want to run the Chrome Cleanup | |
22 // tool. The dialog will have the following sections: | |
23 // | |
24 // 1. Main section with general information about unwanted software that has | |
25 // been found on the user's system. | |
26 // 2. Expandable details section with more details about unwanted software that | |
27 // will be removed and Chrome settings that will be reset. | |
28 // 3. Checkbox asking for permissions to upload logs (not yet implemented). | |
ftirelo
2017/04/05 18:03:40
Please explain the relationship with the controlle
alito
2017/04/05 19:23:49
Done.
| |
29 class SRTPromptDialog : public views::DialogDelegateView, | |
30 public views::ButtonListener { | |
31 public: | |
32 explicit SRTPromptDialog(safe_browsing::SRTPromptController* controller); | |
ftirelo
2017/04/05 18:03:40
Nit: please explain who owns the controller pointe
alito
2017/04/05 19:23:49
Done.
| |
33 ~SRTPromptDialog() override; | |
34 | |
35 void Show(Browser* browser); | |
36 | |
37 // ui::DialogModel overrides. | |
38 bool ShouldDefaultButtonBeBlue() const override; | |
39 | |
40 // views::WidgetDelegate overrides. | |
41 ui::ModalType GetModalType() const override; | |
42 base::string16 GetWindowTitle() const override; | |
43 | |
44 // views::DialogDelegate overrides. | |
45 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
46 bool Accept() override; | |
47 bool Cancel() override; | |
48 | |
49 // views::View overrides. | |
50 gfx::Size GetPreferredSize() const override; | |
51 | |
52 // views::ButtonListener overrides. | |
53 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
54 | |
55 private: | |
56 class ExpandableMessageView; | |
57 | |
58 Browser* browser_; | |
59 safe_browsing::SRTPromptController* controller_; | |
60 bool interaction_done_; | |
61 | |
62 ExpandableMessageView* details_view_; | |
63 views::LabelButton* expand_details_button_; | |
64 SkColor expand_details_button_color_; | |
65 gfx::ImageSkia expand_icon_; | |
66 gfx::ImageSkia fold_icon_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(SRTPromptDialog); | |
69 }; | |
70 | |
71 #endif // CHROME_BROWSER_UI_VIEWS_SRT_PROMPT_DIALOG_H_ | |
OLD | NEW |