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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 } | 703 } |
704 | 704 |
705 bool LocationBarViewMac::IsLocationBarDark() const { | 705 bool LocationBarViewMac::IsLocationBarDark() const { |
706 return [[field_ window] inIncognitoModeWithSystemTheme]; | 706 return [[field_ window] inIncognitoModeWithSystemTheme]; |
707 } | 707 } |
708 | 708 |
709 NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) { | 709 NSImage* LocationBarViewMac::GetKeywordImage(const base::string16& keyword) { |
710 const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile( | 710 const TemplateURL* template_url = TemplateURLServiceFactory::GetForProfile( |
711 profile())->GetTemplateURLForKeyword(keyword); | 711 profile())->GetTemplateURLForKeyword(keyword); |
712 if (template_url && | 712 if (template_url && |
713 (template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION)) { | 713 (template_url->type() == TemplateURL::OMNIBOX_API_EXTENSION)) { |
714 return extensions::OmniboxAPI::Get(profile())-> | 714 return extensions::OmniboxAPI::Get(profile())-> |
715 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage(); | 715 GetOmniboxIcon(template_url->GetExtensionId()).AsNSImage(); |
716 } | 716 } |
717 | 717 |
718 if (ui::MaterialDesignController::IsModeMaterial()) { | 718 if (ui::MaterialDesignController::IsModeMaterial()) { |
719 SkColor icon_color = IsLocationBarDark() ? kMaterialDarkVectorIconColor | 719 SkColor icon_color = IsLocationBarDark() ? kMaterialDarkVectorIconColor |
720 : gfx::kGoogleBlue700; | 720 : gfx::kGoogleBlue700; |
721 return NSImageFromImageSkiaWithColorSpace( | 721 return NSImageFromImageSkiaWithColorSpace( |
722 gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH, | 722 gfx::CreateVectorIcon(gfx::VectorIconId::OMNIBOX_SEARCH, |
723 kDefaultIconSize, icon_color), | 723 kDefaultIconSize, icon_color), |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 OnDecorationsChanged(); | 947 OnDecorationsChanged(); |
948 } | 948 } |
949 | 949 |
950 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { | 950 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { |
951 std::vector<LocationBarDecoration*> decorations = GetDecorations(); | 951 std::vector<LocationBarDecoration*> decorations = GetDecorations(); |
952 std::vector<NSView*> views; | 952 std::vector<NSView*> views; |
953 for (auto* decoration : decorations) | 953 for (auto* decoration : decorations) |
954 views.push_back(decoration->GetAccessibilityView()); | 954 views.push_back(decoration->GetAccessibilityView()); |
955 return views; | 955 return views; |
956 } | 956 } |
OLD | NEW |