| Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
|
| index 5087453f323047a4b245edf5d0713aa1838bd88e..705cc157d18a91ee2cafcbcd35d81ab828921dad 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
|
| @@ -15,6 +15,7 @@
|
| #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
|
| #import "chrome/browser/ui/cocoa/url_drop_target.h"
|
| #import "chrome/browser/ui/cocoa/view_id_util.h"
|
| +#import "ui/base/cocoa/nsview_additions.h"
|
| #include "ui/base/material_design/material_design_controller.h"
|
| #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
|
|
|
| @@ -361,9 +362,20 @@ const CGFloat kAnimationDuration = 0.2;
|
| [nc removeObserver:self
|
| name:NSWindowDidResizeNotification
|
| object:[self window]];
|
| + [nc removeObserver:self
|
| + name:NSWindowDidChangeScreenNotification
|
| + object:[self window]];
|
| }
|
| }
|
|
|
| +- (void)windowDidChangeScreen {
|
| + // Inform the AutocompleteTextFieldCell's of the coordinate system line
|
| + // width needed to draw a single-pixel line. This value changes as we move
|
| + // between Retina and non-Retina displays.
|
| + [[self cell] setSinglePixelLineWidth:[self cr_lineWidth]];
|
| + [self setNeedsDisplay];
|
| +}
|
| +
|
| - (void)viewDidMoveToWindow {
|
| if (![self window]) {
|
| return;
|
| @@ -387,6 +399,14 @@ const CGFloat kAnimationDuration = 0.2;
|
| selector:@selector(windowDidResize:)
|
| name:NSWindowDidResizeNotification
|
| object:[self window]];
|
| + [nc addObserver:self
|
| + selector:@selector(windowDidChangeScreen)
|
| + name:NSWindowDidChangeScreenNotification
|
| + object:[self window]];
|
| +
|
| + // Make sure the cell has the current line width.
|
| + [[self cell] setSinglePixelLineWidth:[self cr_lineWidth]];
|
| +
|
| // Only register for drops if not in a popup window. Lazily create the
|
| // drop handler when the type of window is known.
|
| BrowserWindowController* windowController =
|
|
|