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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 962453002: Update permission bubble anchor when omnibar is hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply Feedback Created 5 years, 9 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/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index b86f3974716cc936f81e7583c84de815b331955c..202a5ac9568498bc88cd8b69427b8545051d0646 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -539,13 +539,6 @@ void BrowserView::InitStatusBubble() {
contents_web_view_->SetStatusBubble(status_bubble_.get());
}
-void BrowserView::InitPermissionBubbleView() {
- std::string languages =
- browser_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
- permission_bubble_view_.reset(new PermissionBubbleViewViews(
- GetLocationBarView()->location_icon_view(), languages));
-}
-
gfx::Rect BrowserView::GetToolbarBounds() const {
gfx::Rect toolbar_bounds(toolbar_->bounds());
if (toolbar_bounds.IsEmpty())
@@ -854,6 +847,11 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
PermissionBubbleManager::FromWebContents(old_contents)->SetView(nullptr);
if (new_contents && PermissionBubbleManager::FromWebContents(new_contents)) {
+ if (!permission_bubble_view_.get()) {
+ permission_bubble_view_.reset(
msw 2015/03/18 18:30:09 optional nit: rename the member to |permission_bub
hcarmona 2015/03/18 23:50:39 Done.
+ new PermissionBubbleViewViews(browser_.get()));
+ }
+
PermissionBubbleManager::FromWebContents(new_contents)->SetView(
permission_bubble_view_.get());
}
@@ -2040,7 +2038,6 @@ void BrowserView::InitViews() {
toolbar_->Init();
InitStatusBubble();
- InitPermissionBubbleView();
// Create do-nothing view for the sake of controlling the z-order of the find
// bar widget.

Powered by Google App Engine
This is Rietveld 408576698