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

Side by Side Diff: ios/chrome/browser/google/google_logo_service.mm

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix compiler error for iOS build by calling the const version of TemplateURLService::GetDefaultSear… Created 3 years, 8 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 | « components/search_engines/template_url_service.cc ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ios/chrome/browser/google/google_logo_service.h" 5 #include "ios/chrome/browser/google/google_logo_service.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 : browser_state_(browser_state) {} 85 : browser_state_(browser_state) {}
86 86
87 GoogleLogoService::~GoogleLogoService() {} 87 GoogleLogoService::~GoogleLogoService() {}
88 88
89 void GoogleLogoService::GetLogo(search_provider_logos::LogoObserver* observer) { 89 void GoogleLogoService::GetLogo(search_provider_logos::LogoObserver* observer) {
90 TemplateURLService* template_url_service = 90 TemplateURLService* template_url_service =
91 ios::TemplateURLServiceFactory::GetForBrowserState(browser_state_); 91 ios::TemplateURLServiceFactory::GetForBrowserState(browser_state_);
92 if (!template_url_service) 92 if (!template_url_service)
93 return; 93 return;
94 94
95 TemplateURL* template_url = template_url_service->GetDefaultSearchProvider(); 95 const TemplateURL* template_url = template_url_service->GetDefaultSearchProvid er();
Peter Kasting 2017/04/17 18:56:59 Nit: 80 columns; git cl format can find this sort
96 if (!template_url || 96 if (!template_url ||
97 !template_url->url_ref().HasGoogleBaseURLs( 97 !template_url->url_ref().HasGoogleBaseURLs(
98 template_url_service->search_terms_data())) 98 template_url_service->search_terms_data()))
99 return; 99 return;
100 100
101 if (!logo_tracker_) { 101 if (!logo_tracker_) {
102 logo_tracker_.reset(new LogoTracker( 102 logo_tracker_.reset(new LogoTracker(
103 DoodleDirectory(), 103 DoodleDirectory(),
104 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), 104 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE),
105 web::WebThread::GetBlockingPool(), browser_state_->GetRequestContext(), 105 web::WebThread::GetBlockingPool(), browser_state_->GetRequestContext(),
(...skipping 21 matching lines...) Expand all
127 cached_metadata_ = empty_metadata; 127 cached_metadata_ = empty_metadata;
128 } 128 }
129 } 129 }
130 130
131 search_provider_logos::Logo GoogleLogoService::GetCachedLogo() { 131 search_provider_logos::Logo GoogleLogoService::GetCachedLogo() {
132 search_provider_logos::Logo logo; 132 search_provider_logos::Logo logo;
133 logo.image = cached_image_; 133 logo.image = cached_image_;
134 logo.metadata = cached_metadata_; 134 logo.metadata = cached_metadata_;
135 return logo; 135 return logo;
136 } 136 }
OLDNEW
« no previous file with comments | « components/search_engines/template_url_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698