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

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: Add comment 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..9e3958da8993e8a55d3289c0a9f918ffff8a55ae 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,8 +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_.get())
+ permission_bubble_.reset(new PermissionBubbleViewViews(browser_.get()));
+
PermissionBubbleManager::FromWebContents(new_contents)->SetView(
- permission_bubble_view_.get());
+ permission_bubble_.get());
}
UpdateUIForContents(new_contents);
@@ -2040,7 +2036,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.
@@ -2291,6 +2286,9 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
// order to let the layout occur.
in_process_fullscreen_ = false;
ToolbarSizeChanged(false);
+
+ if (permission_bubble_.get())
+ permission_bubble_->UpdateAnchorPosition();
}
bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const {
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/website_settings/permissions_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698