| 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 "ui/app_list/search_box_model.h" | 5 #include "ui/app_list/search_box_model.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "ui/app_list/search_box_model_observer.h" | 10 #include "ui/app_list/search_box_model_observer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 SearchBoxModel::SpeechButtonProperty::~SpeechButtonProperty() { | 27 SearchBoxModel::SpeechButtonProperty::~SpeechButtonProperty() { |
| 28 } | 28 } |
| 29 | 29 |
| 30 SearchBoxModel::SearchBoxModel() { | 30 SearchBoxModel::SearchBoxModel() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 SearchBoxModel::~SearchBoxModel() { | 33 SearchBoxModel::~SearchBoxModel() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) { | |
| 37 icon_ = icon; | |
| 38 FOR_EACH_OBSERVER(SearchBoxModelObserver, observers_, IconChanged()); | |
| 39 } | |
| 40 | |
| 41 void SearchBoxModel::SetSpeechRecognitionButton( | 36 void SearchBoxModel::SetSpeechRecognitionButton( |
| 42 std::unique_ptr<SearchBoxModel::SpeechButtonProperty> speech_button) { | 37 std::unique_ptr<SearchBoxModel::SpeechButtonProperty> speech_button) { |
| 43 speech_button_ = std::move(speech_button); | 38 speech_button_ = std::move(speech_button); |
| 44 FOR_EACH_OBSERVER(SearchBoxModelObserver, | 39 FOR_EACH_OBSERVER(SearchBoxModelObserver, |
| 45 observers_, | 40 observers_, |
| 46 SpeechRecognitionButtonPropChanged()); | 41 SpeechRecognitionButtonPropChanged()); |
| 47 } | 42 } |
| 48 | 43 |
| 49 void SearchBoxModel::SetHintText(const base::string16& hint_text) { | 44 void SearchBoxModel::SetHintText(const base::string16& hint_text) { |
| 50 if (hint_text_ == hint_text) | 45 if (hint_text_ == hint_text) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 82 |
| 88 void SearchBoxModel::AddObserver(SearchBoxModelObserver* observer) { | 83 void SearchBoxModel::AddObserver(SearchBoxModelObserver* observer) { |
| 89 observers_.AddObserver(observer); | 84 observers_.AddObserver(observer); |
| 90 } | 85 } |
| 91 | 86 |
| 92 void SearchBoxModel::RemoveObserver(SearchBoxModelObserver* observer) { | 87 void SearchBoxModel::RemoveObserver(SearchBoxModelObserver* observer) { |
| 93 observers_.RemoveObserver(observer); | 88 observers_.RemoveObserver(observer); |
| 94 } | 89 } |
| 95 | 90 |
| 96 } // namespace app_list | 91 } // namespace app_list |
| OLD | NEW |