| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // any). | 52 // any). |
| 53 void Init(content::SessionStorageNamespace* session_storage_namespace, | 53 void Init(content::SessionStorageNamespace* session_storage_namespace, |
| 54 const gfx::Size& size); | 54 const gfx::Size& size); |
| 55 | 55 |
| 56 // Cancels the current request. | 56 // Cancels the current request. |
| 57 void Cancel(); | 57 void Cancel(); |
| 58 | 58 |
| 59 // Tells the Instant search base page to prerender |suggestion|. | 59 // Tells the Instant search base page to prerender |suggestion|. |
| 60 void Prerender(const InstantSuggestion& suggestion); | 60 void Prerender(const InstantSuggestion& suggestion); |
| 61 | 61 |
| 62 // Tells the Instant search base page to render the search results for the | 62 // Tells the Instant search base page to render the search results. |
| 63 // given |query|. | 63 void Commit(const EmbeddedSearchRequestParams& params); |
| 64 void Commit(const base::string16& query, | |
| 65 const EmbeddedSearchRequestParams& params); | |
| 66 | 64 |
| 67 // Returns true if the prerendered page can be used to process the search for | 65 // Returns true if the prerendered page can be used to process the search for |
| 68 // the given |source|. | 66 // the given |source|. |
| 69 bool CanCommitQuery(content::WebContents* source, | 67 bool CanCommitQuery(content::WebContents* source, |
| 70 const base::string16& query) const; | 68 const base::string16& query) const; |
| 71 | 69 |
| 72 // Returns true and updates |params->target_contents| if a prerendered page | 70 // Returns true and updates |params->target_contents| if a prerendered page |
| 73 // exists for |url| and is swapped in. | 71 // exists for |url| and is swapped in. |
| 74 bool UsePrerenderedPage(const GURL& url, chrome::NavigateParams* params); | 72 bool UsePrerenderedPage(const GURL& url, chrome::NavigateParams* params); |
| 75 | 73 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 96 const GURL prerender_url_; | 94 const GURL prerender_url_; |
| 97 | 95 |
| 98 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; | 96 std::unique_ptr<prerender::PrerenderHandle> prerender_handle_; |
| 99 | 97 |
| 100 InstantSuggestion last_instant_suggestion_; | 98 InstantSuggestion last_instant_suggestion_; |
| 101 | 99 |
| 102 DISALLOW_COPY_AND_ASSIGN(InstantSearchPrerenderer); | 100 DISALLOW_COPY_AND_ASSIGN(InstantSearchPrerenderer); |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ | 103 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_SEARCH_PRERENDERER_H_ |
| OLD | NEW |