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

Side by Side Diff: ui/app_list/views/search_box_view.h

Issue 149753002: Enables the 'hotword not listening' icon in the search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix breaks Created 6 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/app_list/views/app_list_view.cc ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_VIEWS_SEARCH_BOX_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ui/app_list/search_box_model_observer.h" 10 #include "ui/app_list/search_box_model_observer.h"
11 #include "ui/app_list/speech_ui_model_observer.h"
11 #include "ui/views/controls/button/image_button.h" 12 #include "ui/views/controls/button/image_button.h"
12 #include "ui/views/controls/button/menu_button_listener.h" 13 #include "ui/views/controls/button/menu_button_listener.h"
13 #include "ui/views/controls/textfield/textfield_controller.h" 14 #include "ui/views/controls/textfield/textfield_controller.h"
14 #include "ui/views/view.h" 15 #include "ui/views/view.h"
15 16
16 namespace views { 17 namespace views {
17 class ImageView; 18 class ImageView;
18 class MenuButton; 19 class MenuButton;
19 class Textfield; 20 class Textfield;
20 } // namespace views 21 } // namespace views
21 22
22 namespace app_list { 23 namespace app_list {
23 24
24 class AppListMenuViews; 25 class AppListMenuViews;
25 class AppListModel; 26 class AppListModel;
26 class AppListViewDelegate; 27 class AppListViewDelegate;
27 class ContentsView; 28 class ContentsView;
28 class SearchBoxModel; 29 class SearchBoxModel;
29 class SearchBoxViewDelegate; 30 class SearchBoxViewDelegate;
30 31
31 // SearchBoxView consists of an icon and a Textfield. SearchBoxModel is its data 32 // SearchBoxView consists of an icon and a Textfield. SearchBoxModel is its data
32 // model that controls what icon to display, what placeholder text to use for 33 // model that controls what icon to display, what placeholder text to use for
33 // Textfield. The text and selection model part could be set to change the 34 // Textfield. The text and selection model part could be set to change the
34 // contents and selection model of the Textfield. 35 // contents and selection model of the Textfield.
35 class SearchBoxView : public views::View, 36 class SearchBoxView : public views::View,
36 public views::TextfieldController, 37 public views::TextfieldController,
37 public views::ButtonListener, 38 public views::ButtonListener,
38 public views::MenuButtonListener, 39 public views::MenuButtonListener,
39 public SearchBoxModelObserver { 40 public SearchBoxModelObserver,
41 public SpeechUIModelObserver {
40 public: 42 public:
41 SearchBoxView(SearchBoxViewDelegate* delegate, 43 SearchBoxView(SearchBoxViewDelegate* delegate,
42 AppListViewDelegate* view_delegate); 44 AppListViewDelegate* view_delegate);
43 virtual ~SearchBoxView(); 45 virtual ~SearchBoxView();
44 46
45 void ModelChanged(); 47 void ModelChanged();
46 bool HasSearch() const; 48 bool HasSearch() const;
47 void ClearSearch(); 49 void ClearSearch();
48 void InvalidateMenu(); 50 void InvalidateMenu();
49 51
(...skipping 29 matching lines...) Expand all
79 virtual void OnMenuButtonClicked(View* source, 81 virtual void OnMenuButtonClicked(View* source,
80 const gfx::Point& point) OVERRIDE; 82 const gfx::Point& point) OVERRIDE;
81 83
82 // Overridden from SearchBoxModelObserver: 84 // Overridden from SearchBoxModelObserver:
83 virtual void IconChanged() OVERRIDE; 85 virtual void IconChanged() OVERRIDE;
84 virtual void SpeechRecognitionButtonPropChanged() OVERRIDE; 86 virtual void SpeechRecognitionButtonPropChanged() OVERRIDE;
85 virtual void HintTextChanged() OVERRIDE; 87 virtual void HintTextChanged() OVERRIDE;
86 virtual void SelectionModelChanged() OVERRIDE; 88 virtual void SelectionModelChanged() OVERRIDE;
87 virtual void TextChanged() OVERRIDE; 89 virtual void TextChanged() OVERRIDE;
88 90
91 // Overridden from SpeechUIModelObserver:
92 virtual void OnSpeechRecognitionStateChanged(
93 SpeechRecognitionState new_state) OVERRIDE;
94
89 SearchBoxViewDelegate* delegate_; // Not owned. 95 SearchBoxViewDelegate* delegate_; // Not owned.
90 AppListViewDelegate* view_delegate_; // Not owned. 96 AppListViewDelegate* view_delegate_; // Not owned.
91 AppListModel* model_; // Owned by the profile-keyed service. 97 AppListModel* model_; // Owned by the profile-keyed service.
92 98
93 scoped_ptr<AppListMenuViews> menu_; 99 scoped_ptr<AppListMenuViews> menu_;
94 100
95 views::ImageView* icon_view_; // Owned by views hierarchy. 101 views::ImageView* icon_view_; // Owned by views hierarchy.
96 views::ImageButton* speech_button_; // Owned by views hierarchy. 102 views::ImageButton* speech_button_; // Owned by views hierarchy.
97 views::MenuButton* menu_button_; // Owned by views hierarchy. 103 views::MenuButton* menu_button_; // Owned by views hierarchy.
98 views::Textfield* search_box_; // Owned by views hierarchy. 104 views::Textfield* search_box_; // Owned by views hierarchy.
99 ContentsView* contents_view_; // Owned by views hierarchy. 105 ContentsView* contents_view_; // Owned by views hierarchy.
100 106
101 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); 107 DISALLOW_COPY_AND_ASSIGN(SearchBoxView);
102 }; 108 };
103 109
104 } // namespace app_list 110 } // namespace app_list
105 111
106 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ 112 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_view.cc ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698