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

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

Issue 2002293002: Use vector icon for Ash shelf launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove include 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 if (template_url && 669 if (template_url &&
670 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) { 670 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) {
671 return extensions::OmniboxAPI::Get(profile())-> 671 return extensions::OmniboxAPI::Get(profile())->
672 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage(); 672 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage();
673 } 673 }
674 674
675 if (ui::MaterialDesignController::IsModeMaterial()) { 675 if (ui::MaterialDesignController::IsModeMaterial()) {
676 SkColor icon_color = IsLocationBarDark() ? kMaterialDarkVectorIconColor 676 SkColor icon_color = IsLocationBarDark() ? kMaterialDarkVectorIconColor
677 : gfx::kGoogleBlue700; 677 : gfx::kGoogleBlue700;
678 return NSImageFromImageSkiaWithColorSpace( 678 return NSImageFromImageSkiaWithColorSpace(
679 gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH, 679 gfx::CreateVectorIcon(gfx::VectorIconId::SEARCH,
680 kDefaultIconSize, icon_color), 680 kDefaultIconSize, icon_color),
681 base::mac::GetSRGBColorSpace()); 681 base::mac::GetSRGBColorSpace());
682 } 682 }
683 683
684 return OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH); 684 return OmniboxViewMac::ImageForResource(IDR_OMNIBOX_SEARCH);
685 } 685 }
686 686
687 void LocationBarViewMac::PostNotification(NSString* notification) { 687 void LocationBarViewMac::PostNotification(NSString* notification) {
688 [[NSNotificationCenter defaultCenter] postNotificationName:notification 688 [[NSNotificationCenter defaultCenter] postNotificationName:notification
689 object:[NSValue valueWithPointer:this]]; 689 object:[NSValue valueWithPointer:this]];
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 815
816 return zoom_decoration_->UpdateIfNecessary( 816 return zoom_decoration_->UpdateIfNecessary(
817 ui_zoom::ZoomController::FromWebContents(web_contents), 817 ui_zoom::ZoomController::FromWebContents(web_contents),
818 default_zoom_changed, IsLocationBarDark()); 818 default_zoom_changed, IsLocationBarDark());
819 } 819 }
820 820
821 void LocationBarViewMac::OnDefaultZoomLevelChanged() { 821 void LocationBarViewMac::OnDefaultZoomLevelChanged() {
822 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) 822 if (UpdateZoomDecoration(/*default_zoom_changed=*/true))
823 OnDecorationsChanged(); 823 OnDecorationsChanged();
824 } 824 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698