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

Side by Side Diff: ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_mediator.mm

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_med iator.h" 5 #import "ios/chrome/browser/ui/contextual_search/touch_to_search_permissions_med iator.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 #pragma mark - Private methods 207 #pragma mark - Private methods
208 208
209 - (BOOL)areContextualSearchQueriesSupported { 209 - (BOOL)areContextualSearchQueriesSupported {
210 TemplateURLService* templateUrlService = 210 TemplateURLService* templateUrlService =
211 ios::TemplateURLServiceFactory::GetForBrowserState(_browserState); 211 ios::TemplateURLServiceFactory::GetForBrowserState(_browserState);
212 if (!templateUrlService) 212 if (!templateUrlService)
213 return NO; 213 return NO;
214 214
215 TemplateURL* defaultURL = templateUrlService->GetDefaultSearchProvider(); 215 const TemplateURL* defaultURL =
216 templateUrlService->GetDefaultSearchProvider();
216 217
217 // Contextual search is supported if the template URL has a non-empty 218 // Contextual search is supported if the template URL has a non-empty
218 // contextual search URL. 219 // contextual search URL.
219 return !defaultURL->contextual_search_url().empty(); 220 return !defaultURL->contextual_search_url().empty();
220 } 221 }
221 222
222 - (BOOL)isVoiceOverEnabled { 223 - (BOOL)isVoiceOverEnabled {
223 return UIAccessibilityIsVoiceOverRunning(); 224 return UIAccessibilityIsVoiceOverRunning();
224 } 225 }
225 226
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 299
299 #pragma mark Notification Center handler 300 #pragma mark Notification Center handler
300 301
301 - (void)statusMayHaveChangedWithNotification:(NSNotification*)notification { 302 - (void)statusMayHaveChangedWithNotification:(NSNotification*)notification {
302 // VoiceOver may have been enabled or disabled, so (if there is an audience 303 // VoiceOver may have been enabled or disabled, so (if there is an audience
303 // object), notify it asynchronously. 304 // object), notify it asynchronously.
304 [self maybeNotifyAudienceAsynchronously]; 305 [self maybeNotifyAudienceAsynchronously];
305 } 306 }
306 307
307 @end 308 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698