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

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

Issue 2861283002: [Mac] Refactor decoration divider code. (Closed)
Patch Set: 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/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 de4f957dfbfb65509fab082a6f9b535a6d1631ca..3fb4f0293b77fa6c57d824f38fd72502dfad0e10 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -327,6 +327,10 @@ bool ContentSettingDecoration::OnMousePressed(NSRect frame, NSPoint location) {
return true;
}
+CGFloat ContentSettingDecoration::DividerPadding() const {
+ return kDividerPadding;
+}
+
NSString* ContentSettingDecoration::GetToolTip() {
return tooltip_.get();
}
@@ -425,17 +429,7 @@ void ContentSettingDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
// Draw the divider if available.
if (state() == DecorationMouseState::NONE && !active()) {
- const CGFloat divider_x_position =
- is_rtl ? NSMinX(background_rect) + kDividerPadding
- : NSMaxX(background_rect) - kDividerPadding;
- NSBezierPath* line = [NSBezierPath bezierPath];
- [line setLineWidth:1];
- [line
- moveToPoint:NSMakePoint(divider_x_position, NSMinY(background_rect))];
- [line
- lineToPoint:NSMakePoint(divider_x_position, NSMaxY(background_rect))];
- [GetDividerColor(owner_->IsLocationBarDark()) set];
- [line stroke];
+ DrawDivider(control_view, background_rect, 1.0);
}
} else {
// No animation, draw the image as normal.

Powered by Google App Engine
This is Rietveld 408576698