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

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

Issue 105773004: Introduces the speech recognition UI to app_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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/search_box_view.cc ('k') | ui/app_list/views/speech_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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_APP_LIST_VIEWS_SPEECH_VIEW_H_
6 #define UI_APP_LIST_VIEWS_SPEECH_VIEW_H_
7
8 #include "ui/app_list/speech_ui_model_observer.h"
9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/view.h"
11
12 namespace views {
13 class BoundsAnimator;
14 class ImageButton;
15 class Label;
16 }
17
18 namespace app_list {
19
20 class AppListViewDelegate;
21 class SpeechCardView;
22
23 // SpeechView provides the card-like UI for the search-by-speech.
24 class SpeechView : public views::View,
25 public views::ButtonListener,
26 public SpeechUIModelObserver {
27 public:
28 explicit SpeechView(AppListViewDelegate* delegate);
29 virtual ~SpeechView();
30
31 // Reset to the original state.
32 void Reset();
33
34 // Overridden from views::View:
35 virtual void Layout() OVERRIDE;
36 virtual gfx::Size GetPreferredSize() OVERRIDE;
37
38 private:
39 int GetIndicatorRadius(int16 level);
40
41 // Overridden from views::ButtonListener:
42 virtual void ButtonPressed(views::Button* sender,
43 const ui::Event& event) OVERRIDE;
44
45 // Overridden from SpeechUIModelObserver:
46 virtual void OnSpeechSoundLevelChanged(int16 level) OVERRIDE;
47 virtual void OnSpeechResult(const base::string16& result,
48 bool is_final) OVERRIDE;
49 virtual void OnSpeechRecognitionStateChanged(
50 SpeechRecognitionState new_state) OVERRIDE;
51
52 AppListViewDelegate* delegate_;
53
54 views::View* indicator_;
55 views::ImageButton* mic_button_;
56 views::Label* speech_result_;
57 scoped_ptr<views::BoundsAnimator> indicator_animator_;
58
59 DISALLOW_COPY_AND_ASSIGN(SpeechView);
60 };
61
62 } // namespace app_list
63
64 #endif // UI_APP_LIST_VIEWS_SPEECH_VIEW_H_
OLDNEW
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698