| 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 UI_APP_LIST_SEARCH_BOX_MODEL_H_ | 5 #ifndef UI_APP_LIST_SEARCH_BOX_MODEL_H_ |
| 6 #define UI_APP_LIST_SEARCH_BOX_MODEL_H_ | 6 #define UI_APP_LIST_SEARCH_BOX_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // text, cursor position and selected text in edit control. | 23 // text, cursor position and selected text in edit control. |
| 24 class APP_LIST_EXPORT SearchBoxModel { | 24 class APP_LIST_EXPORT SearchBoxModel { |
| 25 public: | 25 public: |
| 26 SearchBoxModel(); | 26 SearchBoxModel(); |
| 27 ~SearchBoxModel(); | 27 ~SearchBoxModel(); |
| 28 | 28 |
| 29 // Sets/gets the icon on side of edit box. | 29 // Sets/gets the icon on side of edit box. |
| 30 void SetIcon(const gfx::ImageSkia& icon); | 30 void SetIcon(const gfx::ImageSkia& icon); |
| 31 const gfx::ImageSkia& icon() const { return icon_; } | 31 const gfx::ImageSkia& icon() const { return icon_; } |
| 32 | 32 |
| 33 // Sets/gets the icon indicating which user is logged in. | |
| 34 void SetUserIcon(const gfx::ImageSkia& icon); | |
| 35 const gfx::ImageSkia& user_icon() const { return user_icon_; } | |
| 36 | |
| 37 // Sets/gets the tooltip for the icon that indicates which user is logged in. | |
| 38 void SetUserIconTooltip(const string16& tooltip_text); | |
| 39 const string16& user_icon_tooltip() const { return user_icon_tooltip_; } | |
| 40 | |
| 41 // Sets/gets whether or not we want to show an icon indicating which user is | |
| 42 // logged in. | |
| 43 void SetUserIconEnabled(bool user_icon_enabled); | |
| 44 bool user_icon_enabled() const { return user_icon_enabled_; } | |
| 45 | |
| 46 // Sets/gets the hint text to display when there is in input. | 33 // Sets/gets the hint text to display when there is in input. |
| 47 void SetHintText(const string16& hint_text); | 34 void SetHintText(const string16& hint_text); |
| 48 const string16& hint_text() const { return hint_text_; } | 35 const string16& hint_text() const { return hint_text_; } |
| 49 | 36 |
| 50 // Sets/gets the selection model for the search box's Textfield. | 37 // Sets/gets the selection model for the search box's Textfield. |
| 51 void SetSelectionModel(const gfx::SelectionModel& sel); | 38 void SetSelectionModel(const gfx::SelectionModel& sel); |
| 52 const gfx::SelectionModel& selection_model() const { | 39 const gfx::SelectionModel& selection_model() const { |
| 53 return selection_model_; | 40 return selection_model_; |
| 54 } | 41 } |
| 55 | 42 |
| 56 // Sets/gets the text for the search box's Textfield. | 43 // Sets/gets the text for the search box's Textfield. |
| 57 void SetText(const string16& text); | 44 void SetText(const string16& text); |
| 58 const string16& text() const { return text_; } | 45 const string16& text() const { return text_; } |
| 59 | 46 |
| 60 void AddObserver(SearchBoxModelObserver* observer); | 47 void AddObserver(SearchBoxModelObserver* observer); |
| 61 void RemoveObserver(SearchBoxModelObserver* observer); | 48 void RemoveObserver(SearchBoxModelObserver* observer); |
| 62 | 49 |
| 63 private: | 50 private: |
| 64 gfx::ImageSkia icon_; | 51 gfx::ImageSkia icon_; |
| 65 string16 hint_text_; | 52 string16 hint_text_; |
| 66 gfx::SelectionModel selection_model_; | 53 gfx::SelectionModel selection_model_; |
| 67 string16 text_; | 54 string16 text_; |
| 68 gfx::ImageSkia user_icon_; | |
| 69 string16 user_icon_tooltip_; | |
| 70 bool user_icon_enabled_; | |
| 71 | 55 |
| 72 ObserverList<SearchBoxModelObserver> observers_; | 56 ObserverList<SearchBoxModelObserver> observers_; |
| 73 | 57 |
| 74 DISALLOW_COPY_AND_ASSIGN(SearchBoxModel); | 58 DISALLOW_COPY_AND_ASSIGN(SearchBoxModel); |
| 75 }; | 59 }; |
| 76 | 60 |
| 77 } // namespace app_list | 61 } // namespace app_list |
| 78 | 62 |
| 79 #endif // UI_APP_LIST_SEARCH_BOX_MODEL_H_ | 63 #endif // UI_APP_LIST_SEARCH_BOX_MODEL_H_ |
| OLD | NEW |