| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 // Fill the background. | 355 // Fill the background. |
| 356 [[self backgroundColor] set]; | 356 [[self backgroundColor] set]; |
| 357 if (isPopupMode_) { | 357 if (isPopupMode_) { |
| 358 NSRectFillUsingOperation(NSInsetRect(frame, 1, 1), NSCompositeSourceOver); | 358 NSRectFillUsingOperation(NSInsetRect(frame, 1, 1), NSCompositeSourceOver); |
| 359 } else { | 359 } else { |
| 360 [path fill]; | 360 [path fill]; |
| 361 } | 361 } |
| 362 | 362 |
| 363 // Draw the border. | 363 // Draw the border. |
| 364 const ui::ThemeProvider* provider = [[controlView window] themeProvider]; |
| 365 bool increaseContrast = provider && provider->ShouldIncreaseContrast(); |
| 364 if (!inDarkMode) { | 366 if (!inDarkMode) { |
| 365 const CGFloat kNormalStrokeGray = 168 / 255.; | 367 if (increaseContrast) { |
| 366 [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set]; | 368 [[NSColor blackColor] set]; |
| 369 } else { |
| 370 const CGFloat kNormalStrokeGray = 168 / 255.; |
| 371 [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set]; |
| 372 } |
| 367 } else { | 373 } else { |
| 368 const CGFloat k30PercentAlpha = 0.3; | 374 if (increaseContrast) { |
| 369 [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set]; | 375 [[NSColor whiteColor] set]; |
| 376 } else { |
| 377 const CGFloat k30PercentAlpha = 0.3; |
| 378 [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set]; |
| 379 } |
| 370 } | 380 } |
| 371 [path stroke]; | 381 [path stroke]; |
| 372 | 382 |
| 373 // Draw the interior contents. We do this after drawing the border as some | 383 // Draw the interior contents. We do this after drawing the border as some |
| 374 // of the interior controls draw over it. | 384 // of the interior controls draw over it. |
| 375 [self drawInteriorWithFrame:frame inView:controlView]; | 385 [self drawInteriorWithFrame:frame inView:controlView]; |
| 376 | 386 |
| 377 // Draw the focus ring. | 387 // Draw the focus ring. |
| 378 if (showingFirstResponder) { | 388 if (showingFirstResponder) { |
| 379 CGFloat alphaComponent = 0.5 / singlePixelLineWidth_; | 389 CGFloat alphaComponent = 0.5 / singlePixelLineWidth_; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 | 738 |
| 729 @end | 739 @end |
| 730 | 740 |
| 731 @implementation AutocompleteTextFieldCell (TestingAPI) | 741 @implementation AutocompleteTextFieldCell (TestingAPI) |
| 732 | 742 |
| 733 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations { | 743 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations { |
| 734 return mouseTrackingDecorations_; | 744 return mouseTrackingDecorations_; |
| 735 } | 745 } |
| 736 | 746 |
| 737 @end | 747 @end |
| OLD | NEW |