blob: 6ff604165172320181039f70cd92325b0c0de5fa [file] [log] [blame]
// 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.
#include "base/macros.h"
#include "base/strings/string16.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/window/dialog_delegate.h"
class Browser;
namespace safe_browsing {
class SettingsResetPromptController;
namespace views {
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 {
explicit SettingsResetPromptDialog(
safe_browsing::SettingsResetPromptController* controller);
~SettingsResetPromptDialog() override;
void Show(Browser* browser);
// views::WidgetDelegate overrides.
ui::ModalType GetModalType() const override;
bool ShouldShowWindowIcon() const override;
base::string16 GetWindowTitle() const override;
bool ShouldShowCloseButton() const override;
// views::DialogDelegate overrides.
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
bool Accept() override;
bool Cancel() override;
// We override |Close()| because we want to distinguish in our metrics between
// users clicking the cancel button versus dismissing the dialog in other
// ways.
bool Close() override;
// views::View overrides.
gfx::Size CalculatePreferredSize() const override;
Browser* browser_;
safe_browsing::SettingsResetPromptController* controller_;