Chromium Code Reviews| Index: chrome/browser/ui/browser_dialogs_mac.cc |
| diff --git a/chrome/browser/ui/browser_dialogs_mac.cc b/chrome/browser/ui/browser_dialogs_mac.cc |
| index 1d67a323e947e837dfb2273435149ae864c0a14e..c8d6a08049b5490187fcd123342b1807f1e50d49 100644 |
| --- a/chrome/browser/ui/browser_dialogs_mac.cc |
| +++ b/chrome/browser/ui/browser_dialogs_mac.cc |
| @@ -6,6 +6,8 @@ |
| #include "base/command_line.h" |
| #include "chrome/common/chrome_switches.cc" |
| +#include "ui/gfx/geometry/rect.h" |
| +#include "ui/views/view.h" |
|
tapted
2015/08/10 05:44:23
this include shouldn't be allowed here, but I thin
jackhou1
2015/08/10 09:11:09
Done.
|
| namespace chrome { |
| @@ -14,4 +16,25 @@ bool ToolkitViewsDialogsEnabled() { |
| switches::kEnableMacViewsDialogs); |
| } |
| +void ShowWebsiteSettingsBubbleViewsAtPoint(const gfx::Point& anchor_point, |
| + Profile* profile, |
| + content::WebContents* web_contents, |
| + const GURL& url, |
| + const content::SSLStatus& ssl, |
| + Browser* browser) { |
| + // The views bubble requires an anchor views::View. Create one using the |
| + // anchor point. Since the view doesn't have a container Widget, |
| + // View::ConvertPointToScreen will assume it's origin is 0,0. Create a rect |
| + // where the midpoint of the bottom edge is at the anchor point. |
| + gfx::Rect anchor_view_rect(0, 0, anchor_point.x() * 2, anchor_point.y()); |
| + // WebsiteSettingsPopupView assumes a margin of |
| + // WebsiteSettingsPopupView::kLocationIconVerticalMargin. |
| + anchor_view_rect.Inset(0, 0, 0, -5); |
| + |
| + views::View* anchor_view = new views::View(); |
|
tapted
2015/08/10 05:44:23
memory leak?
This is going to be the hardest thin
jackhou1
2015/08/10 09:11:09
We'd have to make InternalPageInfoPopupView public
|
| + anchor_view->SetBoundsRect(anchor_view_rect); |
| + chrome::ShowWebsiteSettingsBubbleViews(anchor_view, profile, web_contents, |
| + url, ssl, browser); |
| +} |
| + |
| } // namespace chrome |