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_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 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 |
| 72 ExpandableMessageView* details_view_; |
| 73 // The link that expands or hides the details section. |
| 74 views::Link* details_link_; |
| 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptDialog); |
| 77 }; |
| 78 |
| 79 #endif // CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_ |
OLD | NEW |