Chromium Code Reviews| Index: ui/app_list/views/speech_view.h |
| diff --git a/ui/app_list/views/speech_view.h b/ui/app_list/views/speech_view.h |
| index 53a2f7b98f8977726157347380740ac391d43e4e..724c646466e65487a83c134c74ad6c858ae2b752 100644 |
| --- a/ui/app_list/views/speech_view.h |
| +++ b/ui/app_list/views/speech_view.h |
| @@ -8,11 +8,12 @@ |
| #include "ui/app_list/app_list_export.h" |
| #include "ui/app_list/speech_ui_model_observer.h" |
| #include "ui/views/controls/button/button.h" |
| +#include "ui/views/controls/button/image_button.h" |
| +#include "ui/views/masked_targeter_delegate.h" |
| #include "ui/views/view.h" |
| namespace views { |
| class BoundsAnimator; |
| -class ImageButton; |
| class ImageView; |
| class Label; |
| } |
| @@ -22,6 +23,20 @@ namespace app_list { |
| class AppListViewDelegate; |
| class SpeechCardView; |
| +// MicButton is an image button with circular hit area. |
| +class APP_LIST_EXPORT MicButton : public views::ImageButton, |
|
sky
2014/07/09 19:26:04
I would keep this in the .cc. That way it's clear
tdanderson
2014/07/09 20:05:11
Done. Moving it back into the .cc requires me to u
|
| + public views::MaskedTargeterDelegate { |
| + public: |
| + explicit MicButton(views::ButtonListener* listener); |
| + virtual ~MicButton(); |
| + |
| + private: |
| + // views::MaskedTargeterDelegate: |
| + virtual bool GetHitTestMask(gfx::Path* mask) const OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MicButton); |
| +}; |
| + |
| // SpeechView provides the card-like UI for the search-by-speech. |
| class APP_LIST_EXPORT SpeechView : public views::View, |
| public views::ButtonListener, |
| @@ -37,7 +52,7 @@ class APP_LIST_EXPORT SpeechView : public views::View, |
| virtual void Layout() OVERRIDE; |
| virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| - views::ImageButton* mic_button() { return mic_button_; } |
| + MicButton* mic_button() { return mic_button_; } |
| private: |
| int GetIndicatorRadius(uint8 level); |
| @@ -57,7 +72,7 @@ class APP_LIST_EXPORT SpeechView : public views::View, |
| views::ImageView* logo_; |
| views::View* indicator_; |
| - views::ImageButton* mic_button_; |
| + MicButton* mic_button_; |
| views::Label* speech_result_; |
| scoped_ptr<views::BoundsAnimator> indicator_animator_; |