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

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: Fix constness in mock test class 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/settings_reset_prompt_dialog.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bool ShouldDefaultButtonBeBlue() const override;
49
50 // views::DialogDelegate overrides.
51 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
52 views::View* CreateExtraView() override;
53 bool Accept() override;
54 bool Cancel() override;
55
56 // views::View overrides.
57 gfx::Size GetPreferredSize() const override;
58
59 // views::LinkListener overrides.
60 void LinkClicked(views::Link* source, int event_flags) override;
61
62 private:
63 class ExpandableMessageView;
64
65 int ContentWidth() const;
66
67 Browser* browser_;
68 safe_browsing::SettingsResetPromptController* controller_;
69 bool interaction_done_;
70
71 ExpandableMessageView* details_view_;
72 // The link that expands or hides the details section.
73 views::Link* details_link_;
74
75 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptDialog);
76 };
77
78 #endif // CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/settings_reset_prompt_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698