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

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

Issue 2394143004: Harmony - Update anchors for the rest of the location bar icons that (Closed)
Patch Set: actually fix Created 4 years, 2 months 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 38be67ca446e7d4b602ec24e58db590f9852cc1b..6ea354c7b80c567faa40a7528e05b4d745fb0fd3 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -720,10 +720,15 @@ void ManagePasswordsBubbleView::ShowBubble(
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
bool is_fullscreen = browser_view->IsFullscreen();
- ManagePasswordsIconViews* anchor_view =
- is_fullscreen
- ? NULL
- : browser_view->GetLocationBarView()->manage_passwords_icon_view();
+ views::View* anchor_view = nullptr;
+ if (!is_fullscreen) {
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ anchor_view = browser_view->GetLocationBarView();
+ } else {
+ anchor_view =
+ browser_view->GetLocationBarView()->manage_passwords_icon_view();
+ }
+ }
manage_passwords_bubble_ = new ManagePasswordsBubbleView(
web_contents, anchor_view, reason);
@@ -732,8 +737,10 @@ void ManagePasswordsBubbleView::ShowBubble(
views::Widget* manage_passwords_bubble_widget =
views::BubbleDialogDelegateView::CreateBubble(manage_passwords_bubble_);
- if (anchor_view)
- manage_passwords_bubble_widget->AddObserver(anchor_view);
+ if (anchor_view) {
+ manage_passwords_bubble_widget->AddObserver(
+ browser_view->GetLocationBarView()->manage_passwords_icon_view());
+ }
// Adjust for fullscreen after creation as it relies on the content size.
if (is_fullscreen) {
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_bubble_view.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698