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> |
| 8 |
7 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
8 #include "ui/app_list/search_box_model_observer.h" | 10 #include "ui/app_list/search_box_model_observer.h" |
9 | 11 |
10 namespace app_list { | 12 namespace app_list { |
11 | 13 |
12 SearchBoxModel::SpeechButtonProperty::SpeechButtonProperty( | 14 SearchBoxModel::SpeechButtonProperty::SpeechButtonProperty( |
13 const gfx::ImageSkia& on_icon, | 15 const gfx::ImageSkia& on_icon, |
14 const base::string16& on_tooltip, | 16 const base::string16& on_tooltip, |
15 const gfx::ImageSkia& off_icon, | 17 const gfx::ImageSkia& off_icon, |
16 const base::string16& off_tooltip, | 18 const base::string16& off_tooltip, |
(...skipping 14 matching lines...) Expand all Loading... |
31 SearchBoxModel::~SearchBoxModel() { | 33 SearchBoxModel::~SearchBoxModel() { |
32 } | 34 } |
33 | 35 |
34 void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) { | 36 void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) { |
35 icon_ = icon; | 37 icon_ = icon; |
36 FOR_EACH_OBSERVER(SearchBoxModelObserver, observers_, IconChanged()); | 38 FOR_EACH_OBSERVER(SearchBoxModelObserver, observers_, IconChanged()); |
37 } | 39 } |
38 | 40 |
39 void SearchBoxModel::SetSpeechRecognitionButton( | 41 void SearchBoxModel::SetSpeechRecognitionButton( |
40 scoped_ptr<SearchBoxModel::SpeechButtonProperty> speech_button) { | 42 scoped_ptr<SearchBoxModel::SpeechButtonProperty> speech_button) { |
41 speech_button_ = speech_button.Pass(); | 43 speech_button_ = std::move(speech_button); |
42 FOR_EACH_OBSERVER(SearchBoxModelObserver, | 44 FOR_EACH_OBSERVER(SearchBoxModelObserver, |
43 observers_, | 45 observers_, |
44 SpeechRecognitionButtonPropChanged()); | 46 SpeechRecognitionButtonPropChanged()); |
45 } | 47 } |
46 | 48 |
47 void SearchBoxModel::SetHintText(const base::string16& hint_text) { | 49 void SearchBoxModel::SetHintText(const base::string16& hint_text) { |
48 if (hint_text_ == hint_text) | 50 if (hint_text_ == hint_text) |
49 return; | 51 return; |
50 | 52 |
51 hint_text_ = hint_text; | 53 hint_text_ = hint_text; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 void SearchBoxModel::AddObserver(SearchBoxModelObserver* observer) { | 88 void SearchBoxModel::AddObserver(SearchBoxModelObserver* observer) { |
87 observers_.AddObserver(observer); | 89 observers_.AddObserver(observer); |
88 } | 90 } |
89 | 91 |
90 void SearchBoxModel::RemoveObserver(SearchBoxModelObserver* observer) { | 92 void SearchBoxModel::RemoveObserver(SearchBoxModelObserver* observer) { |
91 observers_.RemoveObserver(observer); | 93 observers_.RemoveObserver(observer); |
92 } | 94 } |
93 | 95 |
94 } // namespace app_list | 96 } // namespace app_list |
OLD | NEW |