Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: ui/app_list/search_box_model.h

Issue 69813002: Adds the speech recognition button to the app-list searchbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/cocoa/apps_search_box_controller.mm ('k') | ui/app_list/search_box_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search_box_model.h
diff --git a/ui/app_list/search_box_model.h b/ui/app_list/search_box_model.h
index 764281fc869ada08d6674d6405abfbcf7ab2391f..4cb0b41f6aaa8ce462fbba2a8c5c6cb59e98e7f5 100644
--- a/ui/app_list/search_box_model.h
+++ b/ui/app_list/search_box_model.h
@@ -23,13 +23,37 @@ class SearchBoxModelObserver;
// text, cursor position and selected text in edit control.
class APP_LIST_EXPORT SearchBoxModel {
public:
+ // The properties of the button with toggled status.
+ struct APP_LIST_EXPORT ToggleButtonProperty {
+ ToggleButtonProperty(const gfx::ImageSkia& icon,
+ const gfx::ImageSkia& toggled_icon,
+ const base::string16& tooltip,
+ const base::string16& toggled_tooltip);
+ ~ToggleButtonProperty();
+
+ gfx::ImageSkia icon;
+ gfx::ImageSkia toggled_icon;
+ base::string16 tooltip;
+ base::string16 toggled_tooltip;
+ };
+
SearchBoxModel();
~SearchBoxModel();
- // Sets/gets the icon on side of edit box.
+ // Sets/gets the icon on the left side of edit box.
void SetIcon(const gfx::ImageSkia& icon);
const gfx::ImageSkia& icon() const { return icon_; }
+ // Sets/gets the properties for the button of speech recognition.
+ void SetSpeechRecognitionButton(
+ scoped_ptr<ToggleButtonProperty> speech_button);
+ const ToggleButtonProperty* speech_button() const {
+ return speech_button_.get();
+ }
+
+ // Sets the speech recognition button state.
+ void SetSpeechRecognitionButtonState(bool toggled);
+
// Sets/gets the hint text to display when there is in input.
void SetHintText(const base::string16& hint_text);
const base::string16& hint_text() const { return hint_text_; }
@@ -49,6 +73,7 @@ class APP_LIST_EXPORT SearchBoxModel {
private:
gfx::ImageSkia icon_;
+ scoped_ptr<ToggleButtonProperty> speech_button_;
base::string16 hint_text_;
gfx::SelectionModel selection_model_;
base::string16 text_;
« no previous file with comments | « ui/app_list/cocoa/apps_search_box_controller.mm ('k') | ui/app_list/search_box_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698