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.
5 #ifndef UI_APP_LIST_VIEWS_SPEECH_VIEW_H_
6 #define UI_APP_LIST_VIEWS_SPEECH_VIEW_H_
8 #include "ui/app_list/speech_ui_model_observer.h"
9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/view.h"
21 class AppListViewDelegate;
24 // SpeechView provides the card-like UI for the search-by-speech.
25 class SpeechView : public views::View,
26 public views::ButtonListener,
27 public SpeechUIModelObserver {
29 explicit SpeechView(AppListViewDelegate* delegate);
30 virtual ~SpeechView();
32 // Reset to the original state.
35 // Overridden from views::View:
36 virtual void Layout() OVERRIDE;
37 virtual gfx::Size GetPreferredSize() OVERRIDE;
40 int GetIndicatorRadius(uint8 level);
42 // Overridden from views::ButtonListener:
43 virtual void ButtonPressed(views::Button* sender,
44 const ui::Event& event) OVERRIDE;
46 // Overridden from SpeechUIModelObserver:
47 virtual void OnSpeechSoundLevelChanged(uint8 level) OVERRIDE;
48 virtual void OnSpeechResult(const base::string16& result,
49 bool is_final) OVERRIDE;
50 virtual void OnSpeechRecognitionStateChanged(
51 SpeechRecognitionState new_state) OVERRIDE;
53 AppListViewDelegate* delegate_;
55 views::ImageView* logo_;
56 views::View* indicator_;
57 views::ImageButton* mic_button_;
58 views::Label* speech_result_;
59 scoped_ptr<views::BoundsAnimator> indicator_animator_;
61 DISALLOW_COPY_AND_ASSIGN(SpeechView);
64 } // namespace app_list
66 #endif // UI_APP_LIST_VIEWS_SPEECH_VIEW_H_