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

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

Issue 2701313002: Adds a modal dialog implementation of the settings reset prompt. (Closed)
Patch Set: Addressed sky@'s comments Created 3 years, 10 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_SETTINGS_RESET_PROMPT_DIALOG_H_
6 #define CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
7
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "ui/base/ui_base_types.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/image/image_skia.h"
13 #include "ui/views/controls/link_listener.h"
14 #include "ui/views/window/dialog_delegate.h"
15
16 class Browser;
17
18 namespace safe_browsing {
19 class SettingsResetPromptController;
20 }
21
22 namespace views {
23 class Link;
24 class View;
25 }
26
27 // A dialog intended for prompting users to reset some of their settings to
28 // their original default values. The dialog has two sections:
29 // 1. Main section with an explanation text
30 // 2. An expandable details section containing the details of the reset
31 // operation.
32 class SettingsResetPromptDialog : public views::DialogDelegateView,
33 public views::LinkListener {
34 public:
35 explicit SettingsResetPromptDialog(
36 safe_browsing::SettingsResetPromptController* controller);
37 ~SettingsResetPromptDialog() override;
38
39 void Show(Browser* browser);
40
41 // views::WidgetDelegate overrides.
42 ui::ModalType GetModalType() const override;
43 bool ShouldShowWindowIcon() const override;
44 gfx::ImageSkia GetWindowIcon() override;
45 base::string16 GetWindowTitle() const override;
46
47 // ui::DialogModel overrides.
48 int GetDialogButtons() const override;
49 bool ShouldDefaultButtonBeBlue() const override;
50
51 // views::DialogDelegate overrides.
52 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
53 views::View* CreateExtraView() override;
54 bool Accept() override;
55 bool Cancel() override;
56 bool Close() override;
57
58 // views::View overrides.
59 gfx::Size GetPreferredSize() const override;
60
61 // views::LinkListener overrides.
62 void LinkClicked(views::Link* source, int event_flags) override;
63
64 private:
65 class ExpandableMessageView;
66
67 int ContentWidth() const;
68
69 Browser* browser_;
70 safe_browsing::SettingsResetPromptController* controller_;
71 bool interaction_done_;
72
73 ExpandableMessageView* details_view_;
74 // The link that expands or hides the details section.
75 views::Link* details_link_;
76
77 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptDialog);
78 };
79
80 #endif // CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698