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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 2882533003: [Mac] Hover/Active Omnibox Icon States for Secondary UI MD (Closed)
Patch Set: Move LocationBarDecoration to cocoa Created 3 years, 7 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/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);

Powered by Google App Engine
This is Rietveld 408576698