Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3871)

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 1402363013: Update location bar bubble/icon behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index 7239bc6afd28c93c593d4bb868cc037b77e0d9e7..8ddf95b467c6fcbaec79562d58d143ef63df975a 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -914,7 +914,7 @@ ManagePasswordsBubbleView* ManagePasswordsBubbleView::manage_passwords_bubble_ =
// static
void ManagePasswordsBubbleView::ShowBubble(
content::WebContents* web_contents,
- ManagePasswordsBubbleModel::DisplayReason reason) {
+ DisplayReason reason) {
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
DCHECK(browser);
DCHECK(browser->window());
@@ -940,10 +940,8 @@ void ManagePasswordsBubbleView::ShowBubble(
manage_passwords_bubble_->AdjustForFullscreen(
browser_view->GetBoundsInScreen());
}
- if (reason == ManagePasswordsBubbleModel::AUTOMATIC)
- manage_passwords_bubble_->GetWidget()->ShowInactive();
- else
- manage_passwords_bubble_->GetWidget()->Show();
+
+ manage_passwords_bubble_->ShowForReason(reason);
}
// static
@@ -966,11 +964,13 @@ content::WebContents* ManagePasswordsBubbleView::web_contents() const {
ManagePasswordsBubbleView::ManagePasswordsBubbleView(
content::WebContents* web_contents,
ManagePasswordsIconViews* anchor_view,
- ManagePasswordsBubbleModel::DisplayReason reason)
+ DisplayReason reason)
: LocationBarBubbleDelegateView(anchor_view, web_contents),
- model_(web_contents, reason),
+ model_(web_contents,
+ reason == AUTOMATIC ? ManagePasswordsBubbleModel::AUTOMATIC
+ : ManagePasswordsBubbleModel::USER_ACTION),
anchor_view_(anchor_view),
- initially_focused_view_(NULL) {
+ initially_focused_view_(nullptr) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
@@ -978,8 +978,6 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView(
: views::kPanelVertMargin;
set_margins(gfx::Insets(top_margin, views::kPanelHorizMargin,
views::kPanelVertMargin, views::kPanelHorizMargin));
- if (anchor_view)
- anchor_view->SetActive(true);
mouse_handler_.reset(new WebContentMouseHandler(this));
}
@@ -1004,11 +1002,6 @@ void ManagePasswordsBubbleView::Close() {
LocationBarBubbleDelegateView::Close();
}
-void ManagePasswordsBubbleView::OnWidgetClosing(views::Widget* /*widget*/) {
- if (anchor_view_)
- anchor_view_->SetActive(false);
-}
-
bool ManagePasswordsBubbleView::ShouldShowCloseButton() const {
return model_.state() == password_manager::ui::PENDING_PASSWORD_STATE;
}

Powered by Google App Engine
This is Rietveld 408576698