0

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: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533919}
This commit is contained in:
Peter Boström
2018-02-02 02:15:14 +00:00
committed by Commit Bot
parent 22664f72cf
commit 125696608d
3 changed files with 11 additions and 2 deletions

@ -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.