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

Unified Diff: chrome/browser/ui/views/website_settings/permission_prompt_impl.cc

Issue 2693803002: Fix position of permission bubbles anchored off the padlock. (Closed)
Patch Set: fix ternary if-else (+respond to comments) Created 3 years, 10 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/website_settings/permission_prompt_impl.cc
diff --git a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
index cd97f68e3d5a018257290e59a19567017ac5fe27..eeb72546ed18ad485576d82e959ff3d374e9d1a8 100644
--- a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
+++ b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/browser/ui/views/website_settings/permission_selector_row.h"
@@ -423,6 +424,11 @@ void PermissionPromptImpl::Show(const std::vector<PermissionRequest*>& requests,
bubble_delegate_->set_parent_window(
platform_util::GetViewForWindow(browser_->window()->GetNativeWindow()));
+ // Compensate for vertical padding in the anchor view's image. Note this is
+ // ignored whenever the anchor view is null.
+ bubble_delegate_->set_anchor_view_insets(gfx::Insets(
+ GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
+
views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_)->Show();
bubble_delegate_->SizeToContents();

Powered by Google App Engine
This is Rietveld 408576698