| 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 #include "chrome/browser/ui/search/search_model.h" | 5 #include "chrome/browser/ui/search/search_model.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/search/search_model_observer.h" | 7 #include "chrome/browser/ui/search/search_model_observer.h" |
| 8 #include "components/search/search.h" | 8 #include "components/search/search.h" |
| 9 | 9 |
| 10 SearchModel::State::State() : instant_support(INSTANT_SUPPORT_UNKNOWN) {} | 10 SearchModel::State::State() : instant_support(INSTANT_SUPPORT_NO) {} |
| 11 | 11 |
| 12 SearchModel::State::State(const SearchMode& mode, | 12 SearchModel::State::State(const SearchMode& mode, |
| 13 InstantSupportState instant_support) | 13 InstantSupportState instant_support) |
| 14 : mode(mode), instant_support(instant_support) {} | 14 : mode(mode), instant_support(instant_support) {} |
| 15 | 15 |
| 16 bool SearchModel::State::operator==(const State& rhs) const { | 16 bool SearchModel::State::operator==(const State& rhs) const { |
| 17 return mode == rhs.mode && instant_support == rhs.instant_support; | 17 return mode == rhs.mode && instant_support == rhs.instant_support; |
| 18 } | 18 } |
| 19 | 19 |
| 20 SearchModel::SearchModel() { | 20 SearchModel::SearchModel() { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 observer.ModelChanged(old_state, state_); | 67 observer.ModelChanged(old_state, state_); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SearchModel::AddObserver(SearchModelObserver* observer) { | 70 void SearchModel::AddObserver(SearchModelObserver* observer) { |
| 71 observers_.AddObserver(observer); | 71 observers_.AddObserver(observer); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void SearchModel::RemoveObserver(SearchModelObserver* observer) { | 74 void SearchModel::RemoveObserver(SearchModelObserver* observer) { |
| 75 observers_.RemoveObserver(observer); | 75 observers_.RemoveObserver(observer); |
| 76 } | 76 } |
| OLD | NEW |