Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: chrome/browser/ui/search/search_model.h

Issue 14608004: Move instant support to SearchTabHelper. Fix InstantTab reset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Guard instant-extended-only bits. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/search/instant_tab.cc ('k') | chrome/browser/ui/search/search_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_model.h
diff --git a/chrome/browser/ui/search/search_model.h b/chrome/browser/ui/search/search_model.h
index 9514757a1f78e19db8c0a03d07d219f08293d415..1ac9b97a9c6a93515a02af346ede57b6196c5e7b 100644
--- a/chrome/browser/ui/search/search_model.h
+++ b/chrome/browser/ui/search/search_model.h
@@ -11,15 +11,25 @@
class SearchModelObserver;
+// Represents whether a page supports Instant.
+enum InstantSupportState {
+ INSTANT_SUPPORT_NO,
+ INSTANT_SUPPORT_YES,
+ INSTANT_SUPPORT_UNKNOWN,
+};
+
// An observable model for UI components that care about search model state
// changes.
class SearchModel {
public:
struct State {
- State() : top_bars_visible(true) {}
+ State()
+ : top_bars_visible(true),
+ instant_support(INSTANT_SUPPORT_UNKNOWN) {}
bool operator==(const State& rhs) const {
- return mode == rhs.mode && top_bars_visible == rhs.top_bars_visible;
+ return mode == rhs.mode && top_bars_visible == rhs.top_bars_visible &&
+ instant_support == rhs.instant_support;
}
// The display mode of UI elements such as the toolbar, the tab strip, etc.
@@ -27,6 +37,9 @@ class SearchModel {
// The visibility of top bars such as bookmark and info bars.
bool top_bars_visible;
+
+ // Does the current page support Instant?
+ InstantSupportState instant_support;
};
SearchModel();
@@ -55,6 +68,15 @@ class SearchModel {
// Get the visibility of top bars.
bool top_bars_visible() const { return state_.top_bars_visible; }
+ // Set whether the page supporst Instant. Change notifications are sent to
+ // observers.
+ void SetSupportsInstant(bool supports_instant);
+
+ // Get whether the page supports Instant.
+ InstantSupportState instant_support() const {
+ return state_.instant_support;
+ }
+
// Add and remove observers.
void AddObserver(SearchModelObserver* observer);
void RemoveObserver(SearchModelObserver* observer);
« no previous file with comments | « chrome/browser/ui/search/instant_tab.cc ('k') | chrome/browser/ui/search/search_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698