OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Returns true when prerendering is allowed for the given |source| and | 83 // Returns true when prerendering is allowed for the given |source| and |
84 // |match|. | 84 // |match|. |
85 bool IsAllowed(const AutocompleteMatch& match, | 85 bool IsAllowed(const AutocompleteMatch& match, |
86 content::WebContents* source) const; | 86 content::WebContents* source) const; |
87 | 87 |
88 private: | 88 private: |
89 friend class InstantSearchPrerendererTest; | 89 friend class InstantSearchPrerendererTest; |
90 | 90 |
91 content::WebContents* prerender_contents() const; | 91 content::WebContents* prerender_contents() const; |
92 | 92 |
93 // Returns true if the |query| matches the last prefetched search query or if | |
94 // the 'reuse_instant_search_base_page' flag is enabled in the field trials. | |
95 bool QueryMatchesPrefetch(const base::string16& query) const; | |
96 | |
97 Profile* const profile_; | 93 Profile* const profile_; |
98 | 94 |
99 // Instant search base page URL. | 95 // Instant search base page URL. |
100 const GURL prerender_url_; | 96 const GURL prerender_url_; |
101 | 97 |
102 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; | 98 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; |
103 | 99 |
104 InstantSuggestion last_instant_suggestion_; | 100 InstantSuggestion last_instant_suggestion_; |
105 | 101 |
106 DISALLOW_COPY_AND_ASSIGN(InstantSearchPrerenderer); | 102 DISALLOW_COPY_AND_ASSIGN(InstantSearchPrerenderer); |
107 }; | 103 }; |
108 | 104 |
109 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ | 105 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ |
OLD | NEW |