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..6cc564c72e69eaed939c6fc36a474c7f5db1c6f5 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 02:50:58
nit: this comment feels better above the line that
|
| + gfx::Point origin = gfx::ScreenPointFromNSPoint(anchor); |
| + bubble_bridge_.reset(new ContentSettingBubbleBridge( |
| + model, web_contents, origin)); |
| + bubble_bridge_->Show(); |
| + } else { |
| + [ContentSettingBubbleController showForModel:model |
| + webContents:web_contents |
| + parentWindow:[field window] |
| + anchoredAt:anchor]; |
| + } |
| + |
| return true; |
| } |