Commit ea66307a authored by A Olsen's avatar A Olsen Committed by Commit Bot

Clean up of password dialog ui code -

Split dialog classes and webuis into two different files.
Added a new little class BasePasswordDialog that has the code common to all 3 dialogs.

Bug: 930109
Change-Id: I7c6d407a1eec2fdd297f9943d0119b2b0bc85b0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718805
Commit-Queue: A Olsen <olsen@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681233}
parent 31415b07
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "chrome/browser/chromeos/login/saml/password_expiry_notification.h" #include "chrome/browser/chromeos/login/saml/password_expiry_notification.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.h" #include "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chromeos/login/auth/user_context.h" #include "chromeos/login/auth/user_context.h"
......
...@@ -1645,6 +1645,8 @@ jumbo_split_static_library("ui") { ...@@ -1645,6 +1645,8 @@ jumbo_split_static_library("ui") {
"webui/chromeos/image_source.h", "webui/chromeos/image_source.h",
"webui/chromeos/in_session_password_change/confirm_password_change_handler.cc", "webui/chromeos/in_session_password_change/confirm_password_change_handler.cc",
"webui/chromeos/in_session_password_change/confirm_password_change_handler.h", "webui/chromeos/in_session_password_change/confirm_password_change_handler.h",
"webui/chromeos/in_session_password_change/password_change_dialogs.cc",
"webui/chromeos/in_session_password_change/password_change_dialogs.h",
"webui/chromeos/in_session_password_change/password_change_handler.cc", "webui/chromeos/in_session_password_change/password_change_handler.cc",
"webui/chromeos/in_session_password_change/password_change_handler.h", "webui/chromeos/in_session_password_change/password_change_handler.h",
"webui/chromeos/in_session_password_change/password_change_ui.cc", "webui/chromeos/in_session_password_change/password_change_ui.cc",
......
// Copyright 2019 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 "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h"
#include <memory>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/json/json_writer.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/saml/password_expiry_notification.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/in_session_password_change/confirm_password_change_handler.h"
#include "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_handler.h"
#include "chrome/browser/ui/webui/chromeos/in_session_password_change/urgent_password_expiry_notification_handler.h"
#include "chrome/browser/ui/webui/localized_string.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/constants/chromeos_switches.h"
#include "chromeos/login/auth/saml_password_attributes.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_ui_data_source.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/strings/grit/ui_strings.h"
namespace chromeos {
namespace {
PasswordChangeDialog* g_dialog = nullptr;
ConfirmPasswordChangeDialog* g_confirm_dialog = nullptr;
UrgentPasswordExpiryNotificationDialog* g_notification_dialog = nullptr;
constexpr gfx::Size kPasswordChangeDialogDesiredSize(768, 640);
// TODO(https://crbug.com/930109): Change these numbers depending on what is
// shown in the dialog.
constexpr gfx::Size kConfirmPasswordChangeDialogDesiredSize(520, 380);
constexpr gfx::Size kNotificationDesiredSize = kPasswordChangeDialogDesiredSize;
// Given a desired size, returns the same size if it fits on screen,
// or the closest possible size that will fit on the screen.
gfx::Size FitSizeToDisplay(const gfx::Size& desired) {
const display::Display display =
display::Screen::GetScreen()->GetPrimaryDisplay();
gfx::Size display_size = display.size();
if (display.rotation() == display::Display::ROTATE_90 ||
display.rotation() == display::Display::ROTATE_270) {
display_size = gfx::Size(display_size.height(), display_size.width());
}
return gfx::Size(std::min(desired.width(), display_size.width()),
std::min(desired.height(), display_size.height()));
}
} // namespace
BasePasswordDialog::BasePasswordDialog(GURL url, gfx::Size desired_size)
: SystemWebDialogDelegate(url, /*title=*/base::string16()),
desired_size_(desired_size) {}
BasePasswordDialog::~BasePasswordDialog() {}
void BasePasswordDialog::GetDialogSize(gfx::Size* size) const {
*size = FitSizeToDisplay(desired_size_);
}
void BasePasswordDialog::AdjustWidgetInitParams(
views::Widget::InitParams* params) {
params->type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
ui::ModalType BasePasswordDialog::GetDialogModalType() const {
return ui::ModalType::MODAL_TYPE_SYSTEM;
}
// static
void PasswordChangeDialog::Show() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_dialog) {
g_dialog->Focus();
return;
}
g_dialog = new PasswordChangeDialog();
g_dialog->ShowSystemDialog();
}
// static
void PasswordChangeDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_dialog)
g_dialog->Close();
}
PasswordChangeDialog::PasswordChangeDialog()
: BasePasswordDialog(GURL(chrome::kChromeUIPasswordChangeUrl),
kPasswordChangeDialogDesiredSize) {}
PasswordChangeDialog::~PasswordChangeDialog() {
DCHECK_EQ(this, g_dialog);
g_dialog = nullptr;
}
// static
void ConfirmPasswordChangeDialog::Show(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_confirm_dialog) {
g_confirm_dialog->Focus();
return;
}
g_confirm_dialog = new ConfirmPasswordChangeDialog(
scraped_old_password, scraped_new_password, show_spinner_initially);
g_confirm_dialog->ShowSystemDialog();
}
// static
void ConfirmPasswordChangeDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_confirm_dialog)
g_confirm_dialog->Close();
}
ConfirmPasswordChangeDialog::ConfirmPasswordChangeDialog(
const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially)
: BasePasswordDialog(GURL(chrome::kChromeUIConfirmPasswordChangeUrl),
kConfirmPasswordChangeDialogDesiredSize),
scraped_old_password_(scraped_old_password),
scraped_new_password_(scraped_new_password),
show_spinner_initially_(show_spinner_initially) {}
ConfirmPasswordChangeDialog::~ConfirmPasswordChangeDialog() {
DCHECK_EQ(this, g_confirm_dialog);
g_confirm_dialog = nullptr;
}
std::string ConfirmPasswordChangeDialog::GetDialogArgs() const {
// TODO(https://crbug.com/930109): Configure the embedded UI to only display
// prompts for the passwords that were not scraped.
std::string data;
base::Value dialog_args(base::Value::Type::DICTIONARY);
dialog_args.SetBoolKey("showSpinnerInitially", show_spinner_initially_);
base::JSONWriter::Write(dialog_args, &data);
return data;
}
// static
void UrgentPasswordExpiryNotificationDialog::Show() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_notification_dialog) {
g_notification_dialog->Focus();
return;
}
g_notification_dialog = new UrgentPasswordExpiryNotificationDialog();
g_notification_dialog->ShowSystemDialog();
}
// static
void UrgentPasswordExpiryNotificationDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_notification_dialog)
g_notification_dialog->Close();
}
UrgentPasswordExpiryNotificationDialog::UrgentPasswordExpiryNotificationDialog()
: BasePasswordDialog(
GURL(chrome::kChromeUIUrgentPasswordExpiryNotificationUrl),
kNotificationDesiredSize) {}
UrgentPasswordExpiryNotificationDialog::
~UrgentPasswordExpiryNotificationDialog() {
DCHECK_EQ(this, g_notification_dialog);
g_notification_dialog = nullptr;
}
} // namespace chromeos
// Copyright 2019 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_WEBUI_CHROMEOS_IN_SESSION_PASSWORD_CHANGE_PASSWORD_CHANGE_DIALOGS_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_IN_SESSION_PASSWORD_CHANGE_PASSWORD_CHANGE_DIALOGS_H_
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_ui.h"
namespace chromeos {
// A modal system dialog without any frame decorating it.
class BasePasswordDialog : public SystemWebDialogDelegate {
protected:
BasePasswordDialog(GURL url, gfx::Size desired_size);
~BasePasswordDialog() override;
// ui::WebDialogDelegate:
void GetDialogSize(gfx::Size* size) const override;
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
ui::ModalType GetDialogModalType() const override;
private:
gfx::Size desired_size_;
DISALLOW_COPY_AND_ASSIGN(BasePasswordDialog);
};
// System dialog wrapping chrome:://password-change
class PasswordChangeDialog : public BasePasswordDialog {
public:
static void Show();
static void Dismiss();
protected:
PasswordChangeDialog();
~PasswordChangeDialog() override;
private:
DISALLOW_COPY_AND_ASSIGN(PasswordChangeDialog);
};
// System dialog wrapping chrome://confirm-password-change
class ConfirmPasswordChangeDialog : public BasePasswordDialog {
public:
static void Show(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially);
static void Dismiss();
protected:
ConfirmPasswordChangeDialog(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially);
~ConfirmPasswordChangeDialog() override;
// ui::WebDialogDelegate:
std::string GetDialogArgs() const override;
private:
std::string scraped_old_password_;
std::string scraped_new_password_;
bool show_spinner_initially_ = false;
DISALLOW_COPY_AND_ASSIGN(ConfirmPasswordChangeDialog);
};
// System dialog wrapping chrome://urgent-password-expiry-notification
class UrgentPasswordExpiryNotificationDialog : public BasePasswordDialog {
public:
static void Show();
static void Dismiss();
protected:
UrgentPasswordExpiryNotificationDialog();
~UrgentPasswordExpiryNotificationDialog() override;
private:
DISALLOW_COPY_AND_ASSIGN(UrgentPasswordExpiryNotificationDialog);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_IN_SESSION_PASSWORD_CHANGE_PASSWORD_CHANGE_DIALOGS_H_
...@@ -38,12 +38,6 @@ namespace chromeos { ...@@ -38,12 +38,6 @@ namespace chromeos {
namespace { namespace {
PasswordChangeDialog* g_dialog = nullptr;
ConfirmPasswordChangeDialog* g_confirm_dialog = nullptr;
UrgentPasswordExpiryNotificationDialog* g_notification_dialog = nullptr;
std::string GetPasswordChangeUrl(Profile* profile) { std::string GetPasswordChangeUrl(Profile* profile) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch( if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSamlPasswordChangeUrl)) { switches::kSamlPasswordChangeUrl)) {
...@@ -73,79 +67,8 @@ base::string16 GetHostedHeaderText(const std::string& password_change_url) { ...@@ -73,79 +67,8 @@ base::string16 GetHostedHeaderText(const std::string& password_change_url) {
host); host);
} }
constexpr int kMaxPasswordChangeDialogWidth = 768;
constexpr int kMaxPasswordChangeDialogHeight = 640;
// TODO(https://crbug.com/930109): Change these numbers depending on what is
// shown in the dialog.
constexpr int kMaxConfirmPasswordChangeDialogWidth = 520;
constexpr int kMaxConfirmPasswordChangeDialogHeight = 380;
constexpr int kMaxNotificationDialogWidth = 768;
constexpr int kMaxNotificationDialogHeight = 640;
// Given a desired width and height, returns the same size if it fits on screen,
// or the closest possible size that will fit on the screen.
gfx::Size FitSizeToDisplay(int max_width, int max_height) {
const display::Display display =
display::Screen::GetScreen()->GetPrimaryDisplay();
gfx::Size display_size = display.size();
if (display.rotation() == display::Display::ROTATE_90 ||
display.rotation() == display::Display::ROTATE_270) {
display_size = gfx::Size(display_size.height(), display_size.width());
}
display_size = gfx::Size(std::min(display_size.width(), max_width),
std::min(display_size.height(), max_height));
return display_size;
}
} // namespace } // namespace
PasswordChangeDialog::PasswordChangeDialog()
: SystemWebDialogDelegate(GURL(chrome::kChromeUIPasswordChangeUrl),
/*title=*/base::string16()) {}
PasswordChangeDialog::~PasswordChangeDialog() {
DCHECK_EQ(this, g_dialog);
g_dialog = nullptr;
}
void PasswordChangeDialog::GetDialogSize(gfx::Size* size) const {
*size = FitSizeToDisplay(kMaxPasswordChangeDialogWidth,
kMaxPasswordChangeDialogHeight);
}
void PasswordChangeDialog::AdjustWidgetInitParams(
views::Widget::InitParams* params) {
params->type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
ui::ModalType PasswordChangeDialog::GetDialogModalType() const {
return ui::ModalType::MODAL_TYPE_SYSTEM;
}
// static
void PasswordChangeDialog::Show() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_dialog) {
g_dialog->Focus();
return;
}
g_dialog = new PasswordChangeDialog();
g_dialog->ShowSystemDialog();
}
// static
void PasswordChangeDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_dialog)
g_dialog->Close();
}
PasswordChangeUI::PasswordChangeUI(content::WebUI* web_ui) PasswordChangeUI::PasswordChangeUI(content::WebUI* web_ui)
: ui::WebDialogUI(web_ui) { : ui::WebDialogUI(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
...@@ -173,66 +96,6 @@ PasswordChangeUI::PasswordChangeUI(content::WebUI* web_ui) ...@@ -173,66 +96,6 @@ PasswordChangeUI::PasswordChangeUI(content::WebUI* web_ui)
PasswordChangeUI::~PasswordChangeUI() = default; PasswordChangeUI::~PasswordChangeUI() = default;
// static
void ConfirmPasswordChangeDialog::Show(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_confirm_dialog) {
g_confirm_dialog->Focus();
return;
}
g_confirm_dialog = new ConfirmPasswordChangeDialog(
scraped_old_password, scraped_new_password, show_spinner_initially);
g_confirm_dialog->ShowSystemDialog();
}
// static
void ConfirmPasswordChangeDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_confirm_dialog)
g_confirm_dialog->Close();
}
ConfirmPasswordChangeDialog::ConfirmPasswordChangeDialog(
const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially)
: SystemWebDialogDelegate(GURL(chrome::kChromeUIConfirmPasswordChangeUrl),
/*title=*/base::string16()),
scraped_old_password_(scraped_old_password),
scraped_new_password_(scraped_new_password),
show_spinner_initially_(show_spinner_initially) {}
ConfirmPasswordChangeDialog::~ConfirmPasswordChangeDialog() {
DCHECK_EQ(this, g_confirm_dialog);
g_confirm_dialog = nullptr;
}
void ConfirmPasswordChangeDialog::GetDialogSize(gfx::Size* size) const {
*size = FitSizeToDisplay(kMaxConfirmPasswordChangeDialogWidth,
kMaxConfirmPasswordChangeDialogHeight);
}
std::string ConfirmPasswordChangeDialog::GetDialogArgs() const {
// TODO(https://crbug.com/930109): Configure the embedded UI to only display
// prompts for the passwords that were not scraped.
std::string data;
base::DictionaryValue dialog_args;
dialog_args.SetBoolean("showSpinnerInitially", show_spinner_initially_);
base::JSONWriter::Write(dialog_args, &data);
return data;
}
void ConfirmPasswordChangeDialog::AdjustWidgetInitParams(
views::Widget::InitParams* params) {
params->type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
ui::ModalType ConfirmPasswordChangeDialog::GetDialogModalType() const {
return ui::ModalType::MODAL_TYPE_SYSTEM;
}
ConfirmPasswordChangeUI::ConfirmPasswordChangeUI(content::WebUI* web_ui) ConfirmPasswordChangeUI::ConfirmPasswordChangeUI(content::WebUI* web_ui)
: ui::WebDialogUI(web_ui) { : ui::WebDialogUI(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
...@@ -270,51 +133,6 @@ ConfirmPasswordChangeUI::ConfirmPasswordChangeUI(content::WebUI* web_ui) ...@@ -270,51 +133,6 @@ ConfirmPasswordChangeUI::ConfirmPasswordChangeUI(content::WebUI* web_ui)
ConfirmPasswordChangeUI::~ConfirmPasswordChangeUI() = default; ConfirmPasswordChangeUI::~ConfirmPasswordChangeUI() = default;
UrgentPasswordExpiryNotificationDialog::UrgentPasswordExpiryNotificationDialog()
: SystemWebDialogDelegate(
GURL(chrome::kChromeUIUrgentPasswordExpiryNotificationUrl),
/*title=*/base::string16()) {}
UrgentPasswordExpiryNotificationDialog::
~UrgentPasswordExpiryNotificationDialog() {
DCHECK_EQ(this, g_notification_dialog);
g_notification_dialog = nullptr;
}
void UrgentPasswordExpiryNotificationDialog::GetDialogSize(
gfx::Size* size) const {
*size = FitSizeToDisplay(kMaxNotificationDialogWidth,
kMaxNotificationDialogHeight);
}
void UrgentPasswordExpiryNotificationDialog::AdjustWidgetInitParams(
views::Widget::InitParams* params) {
params->type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS;
}
ui::ModalType UrgentPasswordExpiryNotificationDialog::GetDialogModalType()
const {
return ui::ModalType::MODAL_TYPE_SYSTEM;
}
// static
void UrgentPasswordExpiryNotificationDialog::Show() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_notification_dialog) {
g_notification_dialog->Focus();
return;
}
g_notification_dialog = new UrgentPasswordExpiryNotificationDialog();
g_notification_dialog->ShowSystemDialog();
}
// static
void UrgentPasswordExpiryNotificationDialog::Dismiss() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (g_notification_dialog)
g_notification_dialog->Close();
}
UrgentPasswordExpiryNotificationUI::UrgentPasswordExpiryNotificationUI( UrgentPasswordExpiryNotificationUI::UrgentPasswordExpiryNotificationUI(
content::WebUI* web_ui) content::WebUI* web_ui)
: ui::WebDialogUI(web_ui) { : ui::WebDialogUI(web_ui) {
......
...@@ -12,25 +12,6 @@ ...@@ -12,25 +12,6 @@
namespace chromeos { namespace chromeos {
// System dialog wrapping chrome:://password-change
class PasswordChangeDialog : public SystemWebDialogDelegate {
public:
static void Show();
static void Dismiss();
protected:
PasswordChangeDialog();
~PasswordChangeDialog() override;
// ui::WebDialogDelegate:
void GetDialogSize(gfx::Size* size) const override;
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
ui::ModalType GetDialogModalType() const override;
private:
DISALLOW_COPY_AND_ASSIGN(PasswordChangeDialog);
};
// For chrome:://password-change // For chrome:://password-change
class PasswordChangeUI : public ui::WebDialogUI { class PasswordChangeUI : public ui::WebDialogUI {
public: public:
...@@ -41,34 +22,6 @@ class PasswordChangeUI : public ui::WebDialogUI { ...@@ -41,34 +22,6 @@ class PasswordChangeUI : public ui::WebDialogUI {
DISALLOW_COPY_AND_ASSIGN(PasswordChangeUI); DISALLOW_COPY_AND_ASSIGN(PasswordChangeUI);
}; };
// System dialog wrapping chrome://confirm-password-change
class ConfirmPasswordChangeDialog : public SystemWebDialogDelegate {
public:
static void Show(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially);
static void Dismiss();
protected:
ConfirmPasswordChangeDialog(const std::string& scraped_old_password,
const std::string& scraped_new_password,
bool show_spinner_initially);
~ConfirmPasswordChangeDialog() override;
// ui::WebDialogDelegate:
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
ui::ModalType GetDialogModalType() const override;
private:
std::string scraped_old_password_;
std::string scraped_new_password_;
bool show_spinner_initially_ = false;
DISALLOW_COPY_AND_ASSIGN(ConfirmPasswordChangeDialog);
};
// For chrome:://confirm-password-change // For chrome:://confirm-password-change
class ConfirmPasswordChangeUI : public ui::WebDialogUI { class ConfirmPasswordChangeUI : public ui::WebDialogUI {
public: public:
...@@ -79,25 +32,6 @@ class ConfirmPasswordChangeUI : public ui::WebDialogUI { ...@@ -79,25 +32,6 @@ class ConfirmPasswordChangeUI : public ui::WebDialogUI {
DISALLOW_COPY_AND_ASSIGN(ConfirmPasswordChangeUI); DISALLOW_COPY_AND_ASSIGN(ConfirmPasswordChangeUI);
}; };
// System dialog wrapping chrome://urgent-password-expiry-notification
class UrgentPasswordExpiryNotificationDialog : public SystemWebDialogDelegate {
public:
static void Show();
static void Dismiss();
protected:
UrgentPasswordExpiryNotificationDialog();
~UrgentPasswordExpiryNotificationDialog() override;
// ui::WebDialogDelegate:
void GetDialogSize(gfx::Size* size) const override;
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
ui::ModalType GetDialogModalType() const override;
private:
DISALLOW_COPY_AND_ASSIGN(UrgentPasswordExpiryNotificationDialog);
};
// For chrome:://urgent-password-expiry-notification // For chrome:://urgent-password-expiry-notification
class UrgentPasswordExpiryNotificationUI : public ui::WebDialogUI { class UrgentPasswordExpiryNotificationUI : public ui::WebDialogUI {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment