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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm

Issue 1718563002: Convert location bar decorations to Material Design (Mac). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md_toolbar
Patch Set: Fix issue from browser test. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/bubble_decoration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 #import "base/mac/sdk_forward_declarations.h" 9 #import "base/mac/sdk_forward_declarations.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 name:NSWindowDidResizeNotification 362 name:NSWindowDidResizeNotification
363 object:[self window]]; 363 object:[self window]];
364 } 364 }
365 } 365 }
366 366
367 - (void)viewDidMoveToWindow { 367 - (void)viewDidMoveToWindow {
368 if (![self window]) { 368 if (![self window]) {
369 return; 369 return;
370 } 370 }
371 371
372 // Allow the ToolbarController to take action upon the
373 // AutocompleteTextField being added to the window.
374 if (ui::MaterialDesignController::IsModeMaterial()) {
375 BrowserWindowController* browserWindowController =
376 [BrowserWindowController browserWindowControllerForView:self];
377 [[browserWindowController toolbarController] locationBarWasAddedToWindow];
378 }
379
372 // Invert the textfield's colors when Material Design and Incognito and not 380 // Invert the textfield's colors when Material Design and Incognito and not
373 // a custom theme. 381 // a custom theme.
374 if (ui::MaterialDesignController::IsModeMaterial() && 382 if (ui::MaterialDesignController::IsModeMaterial() &&
375 [[self window] inIncognitoModeWithSystemTheme]) { 383 [[self window] inIncognitoModeWithSystemTheme]) {
376 [self setTextColor:[NSColor whiteColor]]; 384 [self setTextColor:[NSColor whiteColor]];
377 [self setBackgroundColor: 385 [self setBackgroundColor:
378 [NSColor colorWithCalibratedWhite:115 / 255. alpha:1]]; 386 [NSColor colorWithCalibratedWhite:115 / 255. alpha:1]];
379 } 387 }
380 388
381 NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; 389 NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 NSMinY(frame), 541 NSMinY(frame),
534 suggestWidth, 542 suggestWidth,
535 NSHeight(frame)); 543 NSHeight(frame));
536 544
537 gfx::ScopedNSGraphicsContextSaveGState saveGState; 545 gfx::ScopedNSGraphicsContextSaveGState saveGState;
538 NSRectClip(suggestRect); 546 NSRectClip(suggestRect);
539 [cell drawInteriorWithFrame:frame inView:controlView]; 547 [cell drawInteriorWithFrame:frame inView:controlView];
540 } 548 }
541 549
542 } // namespace autocomplete_text_field 550 } // namespace autocomplete_text_field
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/bubble_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698