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

Unified Diff: chrome/browser/speech/speech_input_bubble.h

Issue 6597071: Add a noise indicator to the speech bubble volume indicator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed all review comments. Created 9 years, 10 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
Index: chrome/browser/speech/speech_input_bubble.h
diff --git a/chrome/browser/speech/speech_input_bubble.h b/chrome/browser/speech/speech_input_bubble.h
index dd5d21b463d86dc200dff533de3c68b2c5c09e6e..65e0cf4c556e8d1dd8658e1d6c805e0eab0df71b 100644
--- a/chrome/browser/speech/speech_input_bubble.h
+++ b/chrome/browser/speech/speech_input_bubble.h
@@ -13,9 +13,11 @@
#include "base/task.h"
namespace gfx {
+class Canvas;
class Rect;
}
class SkBitmap;
+class SkCanvas;
class TabContents;
// SpeechInputBubble displays a popup info bubble during speech recognition,
@@ -96,8 +98,8 @@ class SpeechInputBubble {
// |Delegate::InfoBubbleFocusChanged| as well.
virtual void Hide() = 0;
- // Updates the current captured audio volume displayed on screen.
- virtual void SetInputVolume(float volume) = 0;
+ // Updates and draws the current captured audio volume displayed on screen.
+ virtual void SetInputVolume(float volume, float noise_volume) = 0;
// Returns the TabContents for which this bubble gets displayed.
virtual TabContents* tab_contents() = 0;
@@ -129,7 +131,7 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
virtual void SetRecordingMode();
virtual void SetRecognizingMode();
virtual void SetMessage(const string16& text);
- virtual void SetInputVolume(float volume);
+ virtual void SetInputVolume(float volume, float noise_volume);
virtual TabContents* tab_contents();
protected:
@@ -152,6 +154,10 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
private:
void DoRecognizingAnimationStep();
+ void DrawVolumeOverlay(SkCanvas* canvas,
+ const SkBitmap& bitmap,
+ float volume);
+
// Task factory used for animation timer.
ScopedRunnableMethodFactory<SpeechInputBubbleBase> task_factory_;
int animation_step_; // Current index/step of the animation.
@@ -167,6 +173,7 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
TabContents* tab_contents_;
static SkBitmap* mic_full_; // Mic image with full volume.
+ static SkBitmap* mic_noise_; // Mic image with full noise volume.
static SkBitmap* mic_empty_; // Mic image with zero volume.
static SkBitmap* mic_mask_; // Gradient mask used by the volume indicator.
static SkBitmap* spinner_; // Spinner image for the progress animation.

Powered by Google App Engine
This is Rietveld 408576698