Chromium Code Reviews| Index: ui/app_list/search_box_model.cc |
| diff --git a/ui/app_list/search_box_model.cc b/ui/app_list/search_box_model.cc |
| index 5130e501cc882ccc2c252184490a0f260130da80..0da29a2da4a3c4e68fc8257eb6fa4a6c068201d7 100644 |
| --- a/ui/app_list/search_box_model.cc |
| +++ b/ui/app_list/search_box_model.cc |
| @@ -9,6 +9,20 @@ |
| namespace app_list { |
| +SearchBoxModel::RightButtonProperty::RightButtonProperty( |
| + const gfx::ImageSkia& icon, |
| + const gfx::ImageSkia& toggled_icon, |
| + const base::string16& tooltip, |
| + const base::string16& toggled_tooltip) |
| + : icon(icon), |
| + toggled_icon(toggled_icon), |
| + tooltip(tooltip), |
| + toggled_tooltip(toggled_tooltip) { |
| +} |
| + |
| +SearchBoxModel::RightButtonProperty::~RightButtonProperty() { |
| +} |
| + |
| SearchBoxModel::SearchBoxModel() { |
| } |
| @@ -20,6 +34,20 @@ void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) { |
| FOR_EACH_OBSERVER(SearchBoxModelObserver, observers_, IconChanged()); |
| } |
| +void SearchBoxModel::SetRightButton( |
| + scoped_ptr<SearchBoxModel::RightButtonProperty> right_button_prop) { |
| + right_button_prop_.reset(right_button_prop.release()); |
|
xiyuan
2013/11/12 03:09:25
nit: right_button_prop_ = right_button_prop.Pass()
Jun Mukai
2013/11/12 19:24:09
Done.
|
| + FOR_EACH_OBSERVER(SearchBoxModelObserver, |
| + observers_, |
| + RightButtonPropChanged()); |
| +} |
| + |
| +void SearchBoxModel::SetRightButtonState(bool toggled) { |
| + FOR_EACH_OBSERVER(SearchBoxModelObserver, |
| + observers_, |
| + RightButtonStateChanged(toggled)); |
| +} |
| + |
| void SearchBoxModel::SetHintText(const base::string16& hint_text) { |
| if (hint_text_ == hint_text) |
| return; |