| OLD | NEW |
| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 int icon_size = kDefaultIconSize; | 567 int icon_size = kDefaultIconSize; |
| 568 if (ShouldShowEVBubble()) { | 568 if (ShouldShowEVBubble()) { |
| 569 vector_icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; | 569 vector_icon_id = gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_IN_CHIP; |
| 570 vector_icon_color = gfx::kGoogleGreen700; | 570 vector_icon_color = gfx::kGoogleGreen700; |
| 571 icon_size = kMaterialSmallIconSize; | 571 icon_size = kMaterialSmallIconSize; |
| 572 } else { | 572 } else { |
| 573 vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode); | 573 vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode); |
| 574 if (in_dark_mode) { | 574 if (in_dark_mode) { |
| 575 vector_icon_color = SK_ColorWHITE; | 575 vector_icon_color = SK_ColorWHITE; |
| 576 } else { | 576 } else { |
| 577 security_state::SecurityStateModel::SecurityLevel security_level = | 577 vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode); |
| 578 GetToolbarModel()->GetSecurityLevel(false); | |
| 579 if (security_level == security_state::SecurityStateModel::NONE) { | |
| 580 vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode); | |
| 581 } else { | |
| 582 NSColor* sRGBColor = | |
| 583 OmniboxViewMac::GetSecureTextColor(security_level, in_dark_mode); | |
| 584 NSColor* deviceColor = | |
| 585 [sRGBColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; | |
| 586 vector_icon_color = skia::NSDeviceColorToSkColor(deviceColor); | |
| 587 } | |
| 588 } | 578 } |
| 589 } | 579 } |
| 590 | 580 |
| 591 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE); | 581 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE); |
| 592 NSImage* image = NSImageFromImageSkiaWithColorSpace( | 582 NSImage* image = NSImageFromImageSkiaWithColorSpace( |
| 593 gfx::CreateVectorIcon(vector_icon_id, icon_size, vector_icon_color), | 583 gfx::CreateVectorIcon(vector_icon_id, icon_size, vector_icon_color), |
| 594 base::mac::GetSRGBColorSpace()); | 584 base::mac::GetSRGBColorSpace()); |
| 595 | 585 |
| 596 location_icon_decoration_->SetImage(image); | 586 location_icon_decoration_->SetImage(image); |
| 597 ev_bubble_decoration_->SetImage(image); | 587 ev_bubble_decoration_->SetImage(image); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 | 807 |
| 818 return zoom_decoration_->UpdateIfNecessary( | 808 return zoom_decoration_->UpdateIfNecessary( |
| 819 ui_zoom::ZoomController::FromWebContents(web_contents), | 809 ui_zoom::ZoomController::FromWebContents(web_contents), |
| 820 default_zoom_changed, IsLocationBarDark()); | 810 default_zoom_changed, IsLocationBarDark()); |
| 821 } | 811 } |
| 822 | 812 |
| 823 void LocationBarViewMac::OnDefaultZoomLevelChanged() { | 813 void LocationBarViewMac::OnDefaultZoomLevelChanged() { |
| 824 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) | 814 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) |
| 825 OnDecorationsChanged(); | 815 OnDecorationsChanged(); |
| 826 } | 816 } |
| OLD | NEW |