Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| index 9416253c7bbda8d8189a5ecdcdec658025fb8971..bed38207fd74f994de17d86186598c5b7e8ea715 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm |
| @@ -588,6 +588,21 @@ LocationBarDecoration* LocationBarViewMac::GetPageInfoDecoration() const { |
| return location_icon_decoration_.get(); |
| } |
| +LocationBarDecoration* LocationBarViewMac::GetContentSettingDecoration( |
| + NSPoint anchor) const { |
| + NSPoint anchor_in_view = |
| + ui::ConvertPointFromScreenToWindow([field_ window], anchor); |
|
tapted
2017/05/21 08:15:28
This kind of hit testing is usually good to avoid
spqchan
2017/05/23 06:52:37
That makes sense, I'll avoid this
|
| + for (const auto& decoration : content_setting_decorations_) { |
| + if (decoration->IsVisible() && |
| + NSEqualPoints([field_ arrowAnchorPointForDecoration:decoration.get()], |
| + anchor_in_view)) { |
| + return decoration.get(); |
| + } |
| + } |
| + |
| + return nullptr; |
| +} |
| + |
| NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) { |
| const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile( |
| profile())->GetTemplateURLForKeyword(keyword); |