Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm |
| index 194bed68d3b4d1bac49b43708b19a2d7da7002a7..e367f6d182648548e6cd241bb74a09478cfed0b7 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm |
| @@ -12,6 +12,7 @@ |
| #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| +#include "chrome/browser/ui/browser_dialogs.h" |
| #include "chrome/browser/ui/browser_list.h" |
| #import "chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.h" |
| #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" |
| @@ -24,6 +25,7 @@ |
| #include "ui/base/cocoa/appkit_utils.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/gfx/image/image.h" |
| +#include "ui/gfx/mac/coordinate_conversion.h" |
| #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| using content::WebContents; |
| @@ -275,10 +277,21 @@ bool ContentSettingDecoration::OnMousePressed(NSRect frame, NSPoint location) { |
| browser->content_setting_bubble_model_delegate(), |
| web_contents, |
| profile_); |
| - [ContentSettingBubbleController showForModel:model |
| - webContents:web_contents |
| - parentWindow:[field window] |
| - anchoredAt:anchor]; |
| + |
| + if (chrome::ToolkitViewsDialogsEnabled()) { |
| + // Construct the contents with no anchor view; instead this function uses |
| + // |SetExplicitAnchorRect| below to give it an anchor rect directly. |
|
tapted
2016/01/11 23:21:38
update comment?
Elly Fong-Jones
2016/01/12 14:09:59
Done (deleted it)
|
| + gfx::Point origin = gfx::ScreenPointFromNSPoint(anchor); |
| + chrome::ContentSettingBubbleViewsBridge::Show( |
| + [web_contents->GetTopLevelNativeWindow() contentView], |
| + model, web_contents, origin); |
| + } else { |
| + [ContentSettingBubbleController showForModel:model |
| + webContents:web_contents |
| + parentWindow:[field window] |
| + anchoredAt:anchor]; |
| + } |
| + |
| return true; |
| } |