| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_SEARCH_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "chrome/common/search/search_types.h" | 10 #include "chrome/common/search/search_types.h" |
| 11 | 11 |
| 12 class SearchModelObserver; | 12 class SearchModelObserver; |
| 13 | 13 |
| 14 // Represents whether a page supports Instant. | 14 // Represents whether a page supports Instant. |
| 15 enum InstantSupportState { | 15 enum InstantSupportState { |
| 16 INSTANT_SUPPORT_NO, | 16 INSTANT_SUPPORT_NO, |
| 17 INSTANT_SUPPORT_YES, | 17 INSTANT_SUPPORT_YES, |
| 18 INSTANT_SUPPORT_UNKNOWN, | |
| 19 }; | 18 }; |
| 20 | 19 |
| 21 // An observable model for UI components that care about search model state | 20 // An observable model for UI components that care about search model state |
| 22 // changes. | 21 // changes. |
| 23 class SearchModel { | 22 class SearchModel { |
| 24 public: | 23 public: |
| 25 struct State { | 24 struct State { |
| 26 State(); | 25 State(); |
| 27 State(const SearchMode& mode, InstantSupportState instant_support); | 26 State(const SearchMode& mode, InstantSupportState instant_support); |
| 28 | 27 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Current state of model. | 66 // Current state of model. |
| 68 State state_; | 67 State state_; |
| 69 | 68 |
| 70 // Observers. | 69 // Observers. |
| 71 base::ObserverList<SearchModelObserver> observers_; | 70 base::ObserverList<SearchModelObserver> observers_; |
| 72 | 71 |
| 73 DISALLOW_COPY_AND_ASSIGN(SearchModel); | 72 DISALLOW_COPY_AND_ASSIGN(SearchModel); |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ | 75 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_MODEL_H_ |
| OLD | NEW |