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

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

Issue 2104723002: [Material][Mac] Update the incognito vector icon color to white (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: rebased Created 4 years, 5 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 | « chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 namespace { 81 namespace {
82 82
83 // Vertical space between the bottom edge of the location_bar and the first run 83 // Vertical space between the bottom edge of the location_bar and the first run
84 // bubble arrow point. 84 // bubble arrow point.
85 const static int kFirstRunBubbleYOffset = 1; 85 const static int kFirstRunBubbleYOffset = 1;
86 86
87 const int kDefaultIconSize = 16; 87 const int kDefaultIconSize = 16;
88 88
89 // Color of the vector graphic icons when the location bar is dark. 89 // Color of the vector graphic icons when the location bar is dark.
90 // SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF); 90 // SkColorSetARGB(0xCC, 0xFF, 0xFF 0xFF);
91 const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF; 91 const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
92 92
93 } // namespace 93 } // namespace
94 94
95 // A temporary class that draws hardcoded HTTP graphic icons for Material 95 // A temporary class that draws hardcoded HTTP graphic icons for Material
96 // design. This class will be removed once the Material icons are available 96 // design. This class will be removed once the Material icons are available
97 // in M53. 97 // in M53.
98 @interface LocationBarImageRep : NSCustomImageRep 98 @interface LocationBarImageRep : NSCustomImageRep
99 @property(assign, nonatomic) gfx::VectorIconId iconId; 99 @property(assign, nonatomic) gfx::VectorIconId iconId;
100 @property(retain, nonatomic) NSColor* fillColor; 100 @property(retain, nonatomic) NSColor* fillColor;
101 101
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 : gfx::kGoogleGreen700; 746 : gfx::kGoogleGreen700;
747 } else { 747 } else {
748 vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode); 748 vector_icon_id = omnibox_view_->GetVectorIcon(in_dark_mode);
749 if (in_dark_mode) { 749 if (in_dark_mode) {
750 vector_icon_color = SK_ColorWHITE; 750 vector_icon_color = SK_ColorWHITE;
751 } else { 751 } else {
752 vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode); 752 vector_icon_color = OmniboxViewMac::BaseTextColorSkia(in_dark_mode);
753 } 753 }
754 } 754 }
755 755
756 // If the theme is dark, then the color should always be
757 // kMaterialDarkVectorIconColor.
758 if (in_dark_mode)
759 vector_icon_color = kMaterialDarkVectorIconColor;
760
756 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE); 761 DCHECK(vector_icon_id != gfx::VectorIconId::VECTOR_ICON_NONE);
757 NSImage* image = 762 NSImage* image =
758 [LocationBarImageRep imageForId:vector_icon_id color:vector_icon_color]; 763 [LocationBarImageRep imageForId:vector_icon_id color:vector_icon_color];
759 764
760 location_icon_decoration_->SetImage(image); 765 location_icon_decoration_->SetImage(image);
761 ev_bubble_decoration_->SetImage(image); 766 ev_bubble_decoration_->SetImage(image);
762 Layout(); 767 Layout();
763 } 768 }
764 769
765 void LocationBarViewMac::UpdateColorsToMatchTheme() { 770 void LocationBarViewMac::UpdateColorsToMatchTheme() {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 988
984 return zoom_decoration_->UpdateIfNecessary( 989 return zoom_decoration_->UpdateIfNecessary(
985 ui_zoom::ZoomController::FromWebContents(web_contents), 990 ui_zoom::ZoomController::FromWebContents(web_contents),
986 default_zoom_changed, IsLocationBarDark()); 991 default_zoom_changed, IsLocationBarDark());
987 } 992 }
988 993
989 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 994 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
990 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 995 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
991 OnDecorationsChanged(); 996 OnDecorationsChanged();
992 } 997 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_decoration.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698