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

Unified Diff: ui/app_list/views/speech_view.h

Issue 365753002: MicButton should implement MaskedTargeterDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-upload Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | ui/app_list/views/speech_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698