Commit 12569660 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Highlight location-bar password icon.

Highlights the location-bar passwords icon even when the dialog is
triggered without user interaction (for instance when prompting the user
to save credentials).

This is done similarly to highlighting the StarView when the bookmark
bubble shows.

Bug: chromium:654115
Change-Id: Ia8f3a7020336186c83a1aa8ec997c9abd73b8f6a
Reviewed-on: https://chromium-review.googlesource.com/898588
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533919}
parent 22664f72
......@@ -28,6 +28,11 @@ ManagePasswordsIconViews::ManagePasswordsIconViews(CommandUpdater* updater)
ManagePasswordsIconViews::~ManagePasswordsIconViews() {}
void ManagePasswordsIconViews::SetHighlighted() {
if (!GetInkDrop()->IsHighlightFadingInOrVisible())
AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr);
}
void ManagePasswordsIconViews::SetState(password_manager::ui::State state) {
if (state_ == state)
return;
......
......@@ -21,6 +21,8 @@ class ManagePasswordsIconViews : public ManagePasswordsIconView,
explicit ManagePasswordsIconViews(CommandUpdater* updater);
~ManagePasswordsIconViews() override;
void SetHighlighted();
// ManagePasswordsIconView:
void SetState(password_manager::ui::State state) override;
......
......@@ -60,8 +60,10 @@ void PasswordBubbleViewBase::ShowBubble(content::WebContents* web_contents,
views::BubbleDialogDelegateView::CreateBubble(g_manage_passwords_bubble_);
if (anchor_view) {
bubble_widget->AddObserver(
browser_view->GetLocationBarView()->manage_passwords_icon_view());
ManagePasswordsIconViews* const icon =
browser_view->GetLocationBarView()->manage_passwords_icon_view();
bubble_widget->AddObserver(icon);
icon->SetHighlighted();
}
// Adjust for fullscreen after creation as it relies on the content size.
......
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