| 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);
|
|
|