Commit 8f874fa4 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Use new overload of GetToolbarSearchButtonImage

Use GetToolbarSearchButtonImage(SearchEngineIcon) overload and
remove the deprecated old overload of the method (unused and
downstream fixed to not override it already).

Bug: none
Change-Id: I5b115b5df55e7a81333903b0cc788c673e148053
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Reviewed-on: https://chromium-review.googlesource.com/951735
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541764}
parent 32c1dacc
......@@ -53,10 +53,6 @@ source_set("toolbar") {
"//ios/public/provider/chrome/browser/voice",
"//ios/third_party/material_components_ios",
"//ios/web",
# Remove this dependency when the code uses the method
# GetToolbarSearchButtonImage(SearchEngineIcon) overload.
"//ios/chrome/browser/ui/toolbar/buttons/resources:toolbar_search",
]
allow_circular_includes_from = [ "//ios/chrome/browser/ui/location_bar" ]
......
......@@ -314,27 +314,18 @@
#pragma mark - SearchEngineObserving
- (void)searchEngineChanged {
BOOL showBrandedSearchIcon = NO;
if (self.templateURLService) {
const TemplateURL* defaultURL =
self.templateURLService->GetDefaultSearchProvider();
if (defaultURL) {
showBrandedSearchIcon =
defaultURL->GetEngineType(
self.templateURLService->search_terms_data()) ==
SEARCH_ENGINE_GOOGLE;
}
SearchEngineIcon searchEngineIcon = SEARCH_ENGINE_ICON_OTHER;
if (self.templateURLService &&
self.templateURLService->GetDefaultSearchProvider() &&
self.templateURLService->GetDefaultSearchProvider()->GetEngineType(
self.templateURLService->search_terms_data()) ==
SEARCH_ENGINE_GOOGLE) {
searchEngineIcon = SEARCH_ENGINE_ICON_GOOGLE_SEARCH;
}
UIImage* searchIcon = nil;
if (showBrandedSearchIcon) {
searchIcon = ios::GetChromeBrowserProvider()
->GetBrandedImageProvider()
->GetToolbarSearchButtonImage();
}
if (!searchIcon) {
searchIcon = [UIImage imageNamed:@"toolbar_search"];
}
UIImage* searchIcon = ios::GetChromeBrowserProvider()
->GetBrandedImageProvider()
->GetToolbarSearchButtonImage(searchEngineIcon);
[self.consumer setSearchIcon:searchIcon];
}
......
......@@ -8,10 +8,6 @@ source_set("images") {
"branded_image_icon_types.h",
"branded_image_provider.h",
"branded_image_provider.mm",
# This header is deprecated. It will be removed once downstream code
# has been fixed to use branded_image_icon_types.h instead.
"whats_new_icon.h",
]
deps = [
"//base",
......
......@@ -48,10 +48,6 @@ class BrandedImageProvider {
// Returns the 24pt x 24pt image corresponding to the given icon |type|.
virtual UIImage* GetWhatsNewIconImage(WhatsNewIcon type);
// Returns the 38pt x 38pt image to use for the "search the web" button.
// Deprecated, instead use GetToolbarSearchButtonImage(SEARCH_ENGINE_GOOGLE).
virtual UIImage* GetToolbarSearchButtonImage();
// Returns the 38pt x 38pt image to use for the "search the web" button
// corresponding to the |type| search engine.
virtual UIImage* GetToolbarSearchButtonImage(SearchEngineIcon type);
......
......@@ -42,10 +42,6 @@ UIImage* BrandedImageProvider::GetWhatsNewIconImage(WhatsNewIcon type) {
return nil;
}
UIImage* BrandedImageProvider::GetToolbarSearchButtonImage() {
return GetToolbarSearchButtonImage(SEARCH_ENGINE_ICON_GOOGLE_SEARCH);
}
UIImage* BrandedImageProvider::GetToolbarSearchButtonImage(
SearchEngineIcon type) {
return nil;
......
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_IMAGES_WHATS_NEW_ICON_H_
#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_IMAGES_WHATS_NEW_ICON_H_
// This forwarding header is deprecated. It will be removed once the downstream
// code has been fixed to instead use branded_image_icon_types.h instead.
#include "ios/public/provider/chrome/browser/images/branded_image_icon_types.h"
#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_IMAGES_WHATS_NEW_ICON_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment