OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_CONTROLLER_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #include "ui/base/page_transition_types.h" |
| 11 |
| 12 class GURL; |
| 13 @class Tab; |
| 14 |
| 15 namespace ios { |
| 16 class ChromeBrowserState; |
| 17 } |
| 18 |
| 19 namespace web { |
| 20 class NavigationItem; |
| 21 } |
| 22 |
| 23 // Manages using the current device location for omnibox search queries. |
| 24 @interface OmniboxGeolocationController : NSObject |
| 25 |
| 26 // Returns singleton object for this class. |
| 27 + (OmniboxGeolocationController*)sharedInstance; |
| 28 |
| 29 // Triggers the iOS system prompt to authorize the use of location, if the |
| 30 // authorization is not yet determined. |
| 31 // |newUser| specifies whether this is a new user or an existing user |
| 32 - (void)triggerSystemPromptForNewUser:(BOOL)newUser; |
| 33 |
| 34 // Notifies the receiver that the location bar became the first responder. |
| 35 - (void)locationBarDidBecomeFirstResponder: |
| 36 (ios::ChromeBrowserState*)browserState; |
| 37 |
| 38 // Notifies the receiver that the location bar stopped being the first |
| 39 // responder. |
| 40 - (void)locationBarDidResignFirstResponder: |
| 41 (ios::ChromeBrowserState*)browserState; |
| 42 |
| 43 // Notifies the receiver that the user submitted a URL via the location bar. |
| 44 - (void)locationBarDidSubmitURL:(const GURL&)url |
| 45 transition:(ui::PageTransition)transition |
| 46 browserState:(ios::ChromeBrowserState*)browserState; |
| 47 |
| 48 // Adds the current device location to |item| if |item| represents an Omnibox |
| 49 // query that's eligible for location. Returns |YES| if the current device |
| 50 // location was added to |item|; returns |NO| otherwise. |
| 51 - (BOOL)addLocationToNavigationItem:(web::NavigationItem*)item |
| 52 browserState:(ios::ChromeBrowserState*)browserState; |
| 53 |
| 54 // Notifies the receiver that the browser finished loading the page for |tab|. |
| 55 // |loadSuccess| whether the tab loaded successfully |
| 56 - (void)finishPageLoadForTab:(Tab*)tab loadSuccess:(BOOL)loadSuccess; |
| 57 |
| 58 @end |
| 59 |
| 60 #endif // IOS_CHROME_BROWSER_GEOLOCATION_OMNIBOX_GEOLOCATION_CONTROLLER_H_ |
OLD | NEW |