| 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_SEARCH_INSTANT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // necessary. Investigate more and remove this from here. | 79 // necessary. Investigate more and remove this from here. |
| 80 void UpdateThemeInfo(); | 80 void UpdateThemeInfo(); |
| 81 | 81 |
| 82 // Invoked by the InstantController to update most visited items details for | 82 // Invoked by the InstantController to update most visited items details for |
| 83 // NTP. | 83 // NTP. |
| 84 void UpdateMostVisitedItemsInfo(); | 84 void UpdateMostVisitedItemsInfo(); |
| 85 | 85 |
| 86 // Sends the current set of search URLs to a renderer process. | 86 // Sends the current set of search URLs to a renderer process. |
| 87 void SendSearchURLsToRenderer(content::RenderProcessHost* rph); | 87 void SendSearchURLsToRenderer(content::RenderProcessHost* rph); |
| 88 | 88 |
| 89 // Invoked to notify the Instant page that the omnibox start margin has | |
| 90 // changed. | |
| 91 void OnOmniboxStartMarginChanged(int start_margin); | |
| 92 | |
| 93 InstantSearchPrerenderer* instant_search_prerenderer() { | 89 InstantSearchPrerenderer* instant_search_prerenderer() { |
| 94 return instant_prerenderer_.get(); | 90 return instant_prerenderer_.get(); |
| 95 } | 91 } |
| 96 | 92 |
| 97 int omnibox_start_margin() const { return omnibox_start_margin_; } | |
| 98 | |
| 99 private: | 93 private: |
| 100 friend class InstantExtendedTest; | 94 friend class InstantExtendedTest; |
| 101 friend class InstantServiceTest; | 95 friend class InstantServiceTest; |
| 102 friend class InstantTestBase; | 96 friend class InstantTestBase; |
| 103 friend class InstantUnitTestBase; | 97 friend class InstantUnitTestBase; |
| 104 | 98 |
| 105 FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest, | 99 FRIEND_TEST_ALL_PREFIXES(InstantExtendedManualTest, |
| 106 MANUAL_SearchesFromFakebox); | 100 MANUAL_SearchesFromFakebox); |
| 107 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); | 101 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ProcessIsolation); |
| 108 FRIEND_TEST_ALL_PREFIXES(InstantServiceEnabledTest, | 102 FRIEND_TEST_ALL_PREFIXES(InstantServiceEnabledTest, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 155 |
| 162 // InstantMostVisitedItems from TopSites. | 156 // InstantMostVisitedItems from TopSites. |
| 163 std::vector<InstantMostVisitedItem> most_visited_items_; | 157 std::vector<InstantMostVisitedItem> most_visited_items_; |
| 164 | 158 |
| 165 // InstantMostVisitedItems from SuggestionService. | 159 // InstantMostVisitedItems from SuggestionService. |
| 166 std::vector<InstantMostVisitedItem> suggestions_items_; | 160 std::vector<InstantMostVisitedItem> suggestions_items_; |
| 167 | 161 |
| 168 // Theme-related data for NTP overlay to adopt themes. | 162 // Theme-related data for NTP overlay to adopt themes. |
| 169 scoped_ptr<ThemeBackgroundInfo> theme_info_; | 163 scoped_ptr<ThemeBackgroundInfo> theme_info_; |
| 170 | 164 |
| 171 // The start-edge margin of the omnibox, used by the Instant page to align | |
| 172 // text or assets properly with the omnibox. | |
| 173 int omnibox_start_margin_; | |
| 174 | |
| 175 base::ObserverList<InstantServiceObserver> observers_; | 165 base::ObserverList<InstantServiceObserver> observers_; |
| 176 | 166 |
| 177 content::NotificationRegistrar registrar_; | 167 content::NotificationRegistrar registrar_; |
| 178 | 168 |
| 179 scoped_refptr<InstantIOContext> instant_io_context_; | 169 scoped_refptr<InstantIOContext> instant_io_context_; |
| 180 | 170 |
| 181 // Set to NULL if the default search provider does not support Instant. | 171 // Set to NULL if the default search provider does not support Instant. |
| 182 scoped_ptr<InstantSearchPrerenderer> instant_prerenderer_; | 172 scoped_ptr<InstantSearchPrerenderer> instant_prerenderer_; |
| 183 | 173 |
| 184 // Used to check whether notifications from TemplateURLService indicate a | 174 // Used to check whether notifications from TemplateURLService indicate a |
| 185 // change that affects the default search provider. | 175 // change that affects the default search provider. |
| 186 scoped_ptr<TemplateURLData> previous_default_search_provider_; | 176 scoped_ptr<TemplateURLData> previous_default_search_provider_; |
| 187 GURL previous_google_base_url_; | 177 GURL previous_google_base_url_; |
| 188 | 178 |
| 189 // Suggestions Service to fetch server suggestions. | 179 // Suggestions Service to fetch server suggestions. |
| 190 suggestions::SuggestionsService* suggestions_service_; | 180 suggestions::SuggestionsService* suggestions_service_; |
| 191 | 181 |
| 192 // Used for Top Sites async retrieval. | 182 // Used for Top Sites async retrieval. |
| 193 base::WeakPtrFactory<InstantService> weak_ptr_factory_; | 183 base::WeakPtrFactory<InstantService> weak_ptr_factory_; |
| 194 | 184 |
| 195 DISALLOW_COPY_AND_ASSIGN(InstantService); | 185 DISALLOW_COPY_AND_ASSIGN(InstantService); |
| 196 }; | 186 }; |
| 197 | 187 |
| 198 #endif // CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ | 188 #endif // CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| OLD | NEW |