OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_CONTEXTUAL_SEARCH_RESULTS_VIEW_H
_ |
| 6 #define IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_CONTEXTUAL_SEARCH_RESULTS_VIEW_H
_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/contextual_search/contextual_search_controller.h" |
| 11 #import "ios/chrome/browser/ui/contextual_search/contextual_search_panel_protoco
ls.h" |
| 12 #import "url/gurl.h" |
| 13 |
| 14 @class Tab; |
| 15 |
| 16 @protocol ContextualSearchTabPromoter<NSObject> |
| 17 // Expand the search results displayed in the tab retrieved by |tabRetriever| to |
| 18 // a new tab, dismissing the panel. If |headerPressed| is YES, then this is |
| 19 // happening because of a tap on the header view. Otherwise, this is because of |
| 20 // navigation inside the search view. |
| 21 - (void)promoteTabHeaderPressed:(BOOL)headerPressed; |
| 22 @end |
| 23 |
| 24 @protocol ContextualSearchPreloadChecker<NSObject> |
| 25 // YES if it's OK to preload search results. |
| 26 - (BOOL)canPreloadSearchResults; |
| 27 @end |
| 28 |
| 29 @interface ContextualSearchResultsView |
| 30 : UIView<ContextualSearchPanelMotionObserver, |
| 31 ContextualSearchPanelScrollSynchronizer, |
| 32 ContextualSearchTabProvider> |
| 33 @property(nonatomic, assign) BOOL active; |
| 34 // The tab that is credited with opening the search results tab. |
| 35 @property(nonatomic, assign) Tab* opener; |
| 36 // Object that can handle promoting the search results. |
| 37 @property(nonatomic, assign) id<ContextualSearchTabPromoter> promoter; |
| 38 // Object that can determine if search results can be preloaded. |
| 39 @property(nonatomic, assign) id<ContextualSearchPreloadChecker> preloadChecker; |
| 40 // YES if the search results have loaded and this view was visible. |
| 41 @property(nonatomic, readonly) BOOL contentVisible; |
| 42 |
| 43 // Creates an new (internal) Tab object loading |url|; if |preloadEnabled| is |
| 44 // YES, then this tab will start loading as soon as possible, otherwise it will |
| 45 // start loading as soon as this view becomes visible. |
| 46 - (void)createTabForSearch:(GURL)url preloadEnabled:(BOOL)preloadEnabled; |
| 47 |
| 48 // Scroll the search results tab content so the top of the loaded page is |
| 49 // visible. |
| 50 - (void)scrollToTopAnimated:(BOOL)animated; |
| 51 |
| 52 // Record metrics for the loaded search results having finished, marking them |
| 53 // as 'chained' or not according to |chained|. |
| 54 - (void)recordFinishedSearchChained:(BOOL)chained; |
| 55 |
| 56 @end |
| 57 |
| 58 #endif // IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_CONTEXTUAL_SEARCH_RESULTS_VIE
W_H_ |
OLD | NEW |