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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/settings_reset_prompt_dialog.h
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.h b/chrome/browser/ui/views/settings_reset_prompt_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..2eac458811117f725dd4935f5c253a27c21026f2
--- /dev/null
+++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.h
@@ -0,0 +1,78 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
+#define CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "ui/base/ui_base_types.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/image/image_skia.h"
+#include "ui/views/controls/link_listener.h"
+#include "ui/views/window/dialog_delegate.h"
+
+class Browser;
+
+namespace safe_browsing {
+class SettingsResetPromptController;
+}
+
+namespace views {
+class Link;
+class View;
+}
+
+// A dialog intended for prompting users to reset some of their settings to
+// their original default values. The dialog has two sections:
+// 1. Main section with an explanation text
+// 2. An expandable details section containing the details of the reset
+// operation.
+class SettingsResetPromptDialog : public views::DialogDelegateView,
+ public views::LinkListener {
+ public:
+ explicit SettingsResetPromptDialog(
+ safe_browsing::SettingsResetPromptController* controller);
+ ~SettingsResetPromptDialog() override;
+
+ void Show(Browser* browser);
+
+ // views::WidgetDelegate overrides.
+ ui::ModalType GetModalType() const override;
+ bool ShouldShowWindowIcon() const override;
+ gfx::ImageSkia GetWindowIcon() override;
+ base::string16 GetWindowTitle() const override;
+
+ // ui::DialogModel overrides.
+ bool ShouldDefaultButtonBeBlue() const override;
+
+ // views::DialogDelegate overrides.
+ base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
+ views::View* CreateExtraView() override;
+ bool Accept() override;
+ bool Cancel() override;
+
+ // views::View overrides.
+ gfx::Size GetPreferredSize() const override;
+
+ // views::LinkListener overrides.
+ void LinkClicked(views::Link* source, int event_flags) override;
+
+ private:
+ class ExpandableMessageView;
+
+ int ContentWidth() const;
+
+ Browser* browser_;
+ safe_browsing::SettingsResetPromptController* controller_;
+ bool interaction_done_;
+
+ ExpandableMessageView* details_view_;
+ // The link that expands or hides the details section.
+ views::Link* details_link_;
+
+ DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptDialog);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_SETTINGS_RESET_PROMPT_DIALOG_H_
« 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