Commit 6792e22d authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Change the font of the password leak description to more gray.

Bug: 986298
Change-Id: I18c57d1987c64b5c303a02ffb8097d9b011b313f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948896
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721055}
parent 5738109d
...@@ -18,10 +18,8 @@ ...@@ -18,10 +18,8 @@
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/bubble/tooltip_icon.h" #include "ui/views/bubble/tooltip_icon.h"
#include "ui/views/controls/styled_label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h"
using views::BoxLayout;
namespace { namespace {
...@@ -62,32 +60,6 @@ std::unique_ptr<NonAccessibleImageView> CreateIllustration( ...@@ -62,32 +60,6 @@ std::unique_ptr<NonAccessibleImageView> CreateIllustration(
return image_view; return image_view;
} }
// Creates the content containing the title and description for the dialog
// rendered below the illustration.
std::unique_ptr<views::View> CreateContent(const base::string16& title,
const base::string16& description) {
auto content = std::make_unique<views::View>();
content->SetLayoutManager(std::make_unique<BoxLayout>(
BoxLayout::Orientation::kVertical, gfx::Insets(),
views::LayoutProvider::Get()->GetDistanceMetric(
views::DISTANCE_UNRELATED_CONTROL_VERTICAL)));
content->SetBorder(views::CreateEmptyBorder(
views::LayoutProvider::Get()->GetDialogInsetsForContentType(
views::CONTROL, views::CONTROL)));
auto title_label = std::make_unique<views::Label>(
title, views::style::CONTEXT_DIALOG_TITLE, views::style::STYLE_PRIMARY);
title_label->SetMultiLine(true);
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
content->AddChildView(std::move(title_label));
auto description_label =
std::make_unique<views::StyledLabel>(description, nullptr);
content->AddChildView(std::move(description_label));
return content;
}
std::unique_ptr<views::TooltipIcon> CreateInfoIcon() { std::unique_ptr<views::TooltipIcon> CreateInfoIcon() {
auto explanation_tooltip = std::make_unique<views::TooltipIcon>( auto explanation_tooltip = std::make_unique<views::TooltipIcon>(
password_manager::GetLeakDetectionTooltip()); password_manager::GetLeakDetectionTooltip());
...@@ -176,20 +148,26 @@ bool CredentialLeakDialogView::ShouldShowCloseButton() const { ...@@ -176,20 +148,26 @@ bool CredentialLeakDialogView::ShouldShowCloseButton() const {
} }
void CredentialLeakDialogView::OnThemeChanged() { void CredentialLeakDialogView::OnThemeChanged() {
UpdateImageView(image_view_, GetNativeTheme()->ShouldUseDarkColors()); GetBubbleFrameView()->SetHeaderView(
CreateIllustration(GetNativeTheme()->ShouldUseDarkColors()));
}
base::string16 CredentialLeakDialogView::GetWindowTitle() const {
return controller_->GetTitle();
} }
void CredentialLeakDialogView::InitWindow() { void CredentialLeakDialogView::InitWindow() {
SetLayoutManager(std::make_unique<BoxLayout>( SetLayoutManager(std::make_unique<views::FillLayout>());
views::BoxLayout::Orientation::kVertical, gfx::Insets(), SetBorder(views::CreateEmptyBorder(
0 /* between_child_spacing */)); views::LayoutProvider::Get()->GetDialogInsetsForContentType(
std::unique_ptr<NonAccessibleImageView> illustration = views::CONTROL, views::CONTROL)));
CreateIllustration(GetNativeTheme()->ShouldUseDarkColors());
image_view_ = illustration.get(); auto description_label = std::make_unique<views::Label>(
std::unique_ptr<views::View> content = controller_->GetDescription(), views::style::CONTEXT_LABEL,
CreateContent(controller_->GetTitle(), controller_->GetDescription()); views::style::STYLE_SECONDARY);
AddChildView(std::move(illustration)); description_label->SetMultiLine(true);
AddChildView(std::move(content)); description_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(std::move(description_label));
SetExtraView(CreateInfoIcon()); SetExtraView(CreateInfoIcon());
} }
......
...@@ -14,7 +14,6 @@ class WebContents; ...@@ -14,7 +14,6 @@ class WebContents;
} }
class CredentialLeakDialogController; class CredentialLeakDialogController;
class NonAccessibleImageView;
class CredentialLeakDialogView : public views::DialogDelegateView, class CredentialLeakDialogView : public views::DialogDelegateView,
public CredentialLeakPrompt { public CredentialLeakPrompt {
...@@ -37,6 +36,7 @@ class CredentialLeakDialogView : public views::DialogDelegateView, ...@@ -37,6 +36,7 @@ class CredentialLeakDialogView : public views::DialogDelegateView,
int GetDialogButtons() const override; int GetDialogButtons() const override;
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
void OnThemeChanged() override; void OnThemeChanged() override;
base::string16 GetWindowTitle() const override;
// Sets up the child views. // Sets up the child views.
void InitWindow(); void InitWindow();
...@@ -44,7 +44,6 @@ class CredentialLeakDialogView : public views::DialogDelegateView, ...@@ -44,7 +44,6 @@ class CredentialLeakDialogView : public views::DialogDelegateView,
// A weak pointer to the controller. // A weak pointer to the controller.
CredentialLeakDialogController* controller_ = nullptr; CredentialLeakDialogController* controller_ = nullptr;
content::WebContents* const web_contents_ = nullptr; content::WebContents* const web_contents_ = nullptr;
NonAccessibleImageView* image_view_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CredentialLeakDialogView); DISALLOW_COPY_AND_ASSIGN(CredentialLeakDialogView);
}; };
......
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