OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |