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

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

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 + (NSImage*)imageForId:(gfx::VectorIconId)vectorIconId 121 + (NSImage*)imageForId:(gfx::VectorIconId)vectorIconId
122 color:(SkColor)vectorIconColor { 122 color:(SkColor)vectorIconColor {
123 if (vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTP && 123 if (vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTP &&
124 vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID && 124 vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID &&
125 vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID) { 125 vectorIconId != gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID) {
126 return NSImageFromImageSkiaWithColorSpace( 126 return NSImageFromImageSkiaWithColorSpace(
127 gfx::CreateVectorIcon(vectorIconId, kDefaultIconSize, vectorIconColor), 127 gfx::CreateVectorIcon(vectorIconId, kDefaultIconSize, vectorIconColor),
128 base::mac::GetSRGBColorSpace()); 128 base::mac::GetSRGBColorSpace());
129 } 129 }
130 130
131 base::scoped_nsobject<LocationBarImageRep> imageRep = 131 base::scoped_nsobject<LocationBarImageRep> imageRep(
132 [[LocationBarImageRep alloc] 132 [[LocationBarImageRep alloc]
133 initWithDrawSelector:@selector(drawLocationBarIcon:) 133 initWithDrawSelector:@selector(drawLocationBarIcon:)
134 delegate:[LocationBarImageRep class]]; 134 delegate:[LocationBarImageRep class]]);
135 [imageRep setIconId:vectorIconId]; 135 [imageRep setIconId:vectorIconId];
136 [imageRep setFillColor:skia::SkColorToSRGBNSColor(vectorIconColor)]; 136 [imageRep setFillColor:skia::SkColorToSRGBNSColor(vectorIconColor)];
137 137
138 // Create the image from the image rep. 138 // Create the image from the image rep.
139 const NSSize kImageSize = NSMakeSize(kDefaultIconSize, kDefaultIconSize); 139 const NSSize kImageSize = NSMakeSize(kDefaultIconSize, kDefaultIconSize);
140 NSImage* locationBarImage = 140 NSImage* locationBarImage =
141 [[[NSImage alloc] initWithSize:kImageSize] autorelease]; 141 [[[NSImage alloc] initWithSize:kImageSize] autorelease];
142 [locationBarImage setCacheMode:NSImageCacheAlways]; 142 [locationBarImage setCacheMode:NSImageCacheAlways];
143 [locationBarImage addRepresentation:imageRep]; 143 [locationBarImage addRepresentation:imageRep];
144 144
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 969
970 return zoom_decoration_->UpdateIfNecessary( 970 return zoom_decoration_->UpdateIfNecessary(
971 ui_zoom::ZoomController::FromWebContents(web_contents), 971 ui_zoom::ZoomController::FromWebContents(web_contents),
972 default_zoom_changed, IsLocationBarDark()); 972 default_zoom_changed, IsLocationBarDark());
973 } 973 }
974 974
975 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 975 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
976 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 976 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
977 OnDecorationsChanged(); 977 OnDecorationsChanged();
978 } 978 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h ('k') | chrome/browser/ui/cocoa/new_tab_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698