OLD | NEW |
---|---|
(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.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 class AppListViewDelegate; | |
xiyuan
2013/12/05 22:06:30
nit: insert an empty line above.
Jun Mukai
2013/12/06 00:31:10
Done.
| |
20 class SpeechCardView; | |
21 | |
22 // SpeechView provides the card-like UI for the search-by-speech. | |
23 class SpeechView : public views::View, | |
24 public views::ButtonListener, | |
25 public SpeechUIModelObserver { | |
26 public: | |
27 SpeechView(AppListViewDelegate* delegate); | |
xiyuan
2013/12/05 22:06:30
nit: explicit
Jun Mukai
2013/12/06 00:31:10
Done.
| |
28 virtual ~SpeechView(); | |
29 | |
30 // Reset to the original state. | |
31 void Reset(); | |
32 | |
33 // The maximum height of the speech card. | |
34 static const int kMaxHeight; | |
xiyuan
2013/12/05 22:06:30
nit: prefer to override GetPreferredSize instead o
Jun Mukai
2013/12/06 00:31:10
Done.
| |
35 | |
36 private: | |
37 int GetIndicatorRadius(int16 level); | |
38 | |
39 // Overridden from views::View: | |
40 virtual void Layout() OVERRIDE; | |
41 | |
42 // Overridden from views::ButtonListener: | |
43 virtual void ButtonPressed(views::Button* sender, | |
44 const ui::Event& event) OVERRIDE; | |
45 | |
46 // Overridden from SpeechUIModelObserver: | |
47 virtual void OnSpeechSoundLevelChanged(int16 level) OVERRIDE; | |
48 virtual void OnSpeechResult(const base::string16& result, | |
49 bool is_final) OVERRIDE; | |
50 virtual void OnSpeechRecognitionStateChanged( | |
51 SpeechRecognitionState new_state) OVERRIDE; | |
52 | |
53 AppListViewDelegate* delegate_; | |
54 | |
55 views::View* indicator_; | |
56 views::ImageButton* mic_button_; | |
57 views::Label* speech_result_; | |
58 scoped_ptr<views::BoundsAnimator> indicator_animator_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(SpeechView); | |
61 }; | |
62 | |
63 } // namespace app_list | |
64 | |
65 #endif // UI_APP_LIST_VIEWS_SPEECH_VIEW_H_ | |
OLD | NEW |