Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: chrome/browser/ui/views/srt_prompt_dialog.h

Issue 2795133002: Chrome Cleaner UI: Add a dialog class for the new UI (Closed)
Patch Set: Addressed Fabio's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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).
29 //
30 // The strings and icons used in the dialog are provided by a
31 // |SRTPromptController| object, which will also receive information about how
32 // the user interacts with the dialog. The controller object owns itself and
33 // will delete itself once it has received information about the user's
34 // interaction with the dialog. See the |SRTPromptController| class's
35 // description for more details.
36 class SRTPromptDialog : public views::DialogDelegateView,
sky 2017/04/05 21:17:42 Current naming rules suggest this should SrtPrompt
alito 2017/04/06 00:20:22 There is a legacy problem in that we have a lot of
37 public views::ButtonListener {
38 public:
39 // The |controller| object manages its own lifetime and is not owned by
sky 2017/04/05 21:17:42 If controller manages its own lifetime how do you
alito 2017/04/06 00:20:22 The contract (described by the controller class's
sky 2017/04/06 16:01:02 In that case, it seems you should null out control
alito 2017/04/06 17:35:37 Done.
40 // |SRTPromptDialog|. See the description of the |SRTPromptController| class
41 // for details.
42 explicit SRTPromptDialog(safe_browsing::SRTPromptController* controller);
43 ~SRTPromptDialog() override;
44
45 void Show(Browser* browser);
46
47 // ui::DialogModel overrides.
48 bool ShouldDefaultButtonBeBlue() const override;
49
50 // views::WidgetDelegate overrides.
51 ui::ModalType GetModalType() const override;
52 base::string16 GetWindowTitle() const override;
53
54 // views::DialogDelegate overrides.
55 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
56 bool Accept() override;
57 bool Cancel() override;
58
59 // views::View overrides.
60 gfx::Size GetPreferredSize() const override;
61
62 // views::ButtonListener overrides.
63 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
64
65 private:
66 class ExpandableMessageView;
67
68 Browser* browser_;
69 safe_browsing::SRTPromptController* controller_;
70 bool interaction_done_;
sky 2017/04/05 21:17:42 Add description.
alito 2017/04/06 00:20:23 Done.
71
72 ExpandableMessageView* details_view_;
73 views::LabelButton* expand_details_button_;
74 SkColor expand_details_button_color_;
75 gfx::ImageSkia expand_icon_;
76 gfx::ImageSkia fold_icon_;
77
78 DISALLOW_COPY_AND_ASSIGN(SRTPromptDialog);
79 };
80
81 #endif // CHROME_BROWSER_UI_VIEWS_SRT_PROMPT_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698