OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 // Sends a collection of MostVisitedItems to the renderer process via | 353 // Sends a collection of MostVisitedItems to the renderer process via |
354 // the appropriate InstantPage subclass. | 354 // the appropriate InstantPage subclass. |
355 void SendMostVisitedItems( | 355 void SendMostVisitedItems( |
356 const std::vector<InstantMostVisitedItemIDPair>& items); | 356 const std::vector<InstantMostVisitedItemIDPair>& items); |
357 | 357 |
358 // If possible, tries to mutate |suggestion| to a valid suggestion. Returns | 358 // If possible, tries to mutate |suggestion| to a valid suggestion. Returns |
359 // true if successful. (Note that |suggestion| may be modified even if this | 359 // true if successful. (Note that |suggestion| may be modified even if this |
360 // returns false.) | 360 // returns false.) |
361 bool FixSuggestion(InstantSuggestion* suggestion) const; | 361 bool FixSuggestion(InstantSuggestion* suggestion) const; |
362 | 362 |
363 // Returns true if we should use |instant_tab_| instead of |overlay_| for | |
364 // handling suggestions. | |
365 // TODO(samarth|sreeram): this is brittle. Instead, we should probably just | |
366 // combine the two local pages into one. | |
367 bool UseInstantTabToShowSuggestions() const; | |
368 | |
369 // Returns true if we should switch to using the local NTP. | 363 // Returns true if we should switch to using the local NTP. |
370 bool ShouldSwitchToLocalNTP() const; | 364 bool ShouldSwitchToLocalNTP() const; |
371 | 365 |
372 BrowserInstantController* const browser_; | 366 BrowserInstantController* const browser_; |
373 | 367 |
374 // Whether the extended API and regular API are enabled. If both are false, | 368 // Whether the extended API and regular API are enabled. If both are false, |
375 // Instant is effectively disabled. | 369 // Instant is effectively disabled. |
376 const bool extended_enabled_; | 370 const bool extended_enabled_; |
377 bool instant_enabled_; | 371 bool instant_enabled_; |
378 | 372 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // Used for Top Sites async retrieval. | 464 // Used for Top Sites async retrieval. |
471 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 465 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
472 | 466 |
473 // Used to get notifications about Most Visted changes. | 467 // Used to get notifications about Most Visted changes. |
474 content::NotificationRegistrar registrar_; | 468 content::NotificationRegistrar registrar_; |
475 | 469 |
476 DISALLOW_COPY_AND_ASSIGN(InstantController); | 470 DISALLOW_COPY_AND_ASSIGN(InstantController); |
477 }; | 471 }; |
478 | 472 |
479 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 473 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
OLD | NEW |