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

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

Issue 2013183003: [Mac][Material Design] Bring Omnibox stroke and MD colors up to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. Created 4 years, 6 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/location_bar_view_mac.h" 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #import "base/mac/mac_util.h" 9 #import "base/mac/mac_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 ? LocationBarDecoration::kMaterialDarkModeTextColor 576 ? LocationBarDecoration::kMaterialDarkModeTextColor
577 : gfx::kGoogleGreen700; 577 : gfx::kGoogleGreen700;
578 icon_size = kMaterialIconSize; 578 icon_size = kMaterialIconSize;
579 } else { 579 } else {
580 vector_icon_id = omnibox_view_->GetVectorIcon(); 580 vector_icon_id = omnibox_view_->GetVectorIcon();
581 if (in_dark_mode) { 581 if (in_dark_mode) {
582 vector_icon_color = SK_ColorWHITE; 582 vector_icon_color = SK_ColorWHITE;
583 } else { 583 } else {
584 security_state::SecurityStateModel::SecurityLevel security_level = 584 security_state::SecurityStateModel::SecurityLevel security_level =
585 GetToolbarModel()->GetSecurityLevel(false); 585 GetToolbarModel()->GetSecurityLevel(false);
586 vector_icon_color = 586 if (security_level == security_state::SecurityStateModel::NONE) {
587 (security_level == security_state::SecurityStateModel::NONE) 587 vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode);
588 ? OmniboxViewMac::BaseTextColorSkia(in_dark_mode) 588 } else {
589 : skia::NSDeviceColorToSkColor(OmniboxViewMac::GetSecureTextColor( 589 NSColor* sRGBColor =
590 security_level, in_dark_mode)); 590 OmniboxViewMac::GetSecureTextColor(security_level, in_dark_mode);
591 NSColor* deviceColor =
592 [sRGBColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
593 vector_icon_color = skia::NSDeviceColorToSkColor(deviceColor);
594 }
591 } 595 }
592 } 596 }
593 597
594 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE); 598 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE);
595 NSImage* image = NSImageFromImageSkiaWithColorSpace( 599 NSImage* image = NSImageFromImageSkiaWithColorSpace(
596 gfx::CreateVectorIcon(vector_icon_id, icon_size, vector_icon_color), 600 gfx::CreateVectorIcon(vector_icon_id, icon_size, vector_icon_color),
597 base::mac::GetSRGBColorSpace()); 601 base::mac::GetSRGBColorSpace());
598 602
599 location_icon_decoration_->SetImage(image); 603 location_icon_decoration_->SetImage(image);
600 ev_bubble_decoration_->SetImage(image); 604 ev_bubble_decoration_->SetImage(image);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 821
818 return zoom_decoration_->UpdateIfNecessary( 822 return zoom_decoration_->UpdateIfNecessary(
819 ui_zoom::ZoomController::FromWebContents(web_contents), 823 ui_zoom::ZoomController::FromWebContents(web_contents),
820 default_zoom_changed, IsLocationBarDark()); 824 default_zoom_changed, IsLocationBarDark());
821 } 825 }
822 826
823 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 827 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
824 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 828 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
825 OnDecorationsChanged(); 829 OnDecorationsChanged();
826 } 830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698