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

Side by Side Diff: chrome/browser/speech/speech_recognition_bubble.h

Issue 10859002: Speech bubble: Use the images of the appropriate scale for the speech bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/speech/speech_recognition_bubble.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_ 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_
6 #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_ 6 #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "ui/base/layout.h"
13 14
14 class SkBitmap; 15 class SkBitmap;
15 class SkCanvas; 16 class SkCanvas;
16 17
17 namespace content { 18 namespace content {
18 class WebContents; 19 class WebContents;
19 } 20 }
20 21
21 namespace gfx { 22 namespace gfx {
22 class Canvas; 23 class Canvas;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void DoWarmingUpAnimationStep(); 164 void DoWarmingUpAnimationStep();
164 void SetImage(const gfx::ImageSkia& image); 165 void SetImage(const gfx::ImageSkia& image);
165 166
166 void DrawVolumeOverlay(SkCanvas* canvas, 167 void DrawVolumeOverlay(SkCanvas* canvas,
167 const gfx::ImageSkia& image_skia, 168 const gfx::ImageSkia& image_skia,
168 float volume); 169 float volume);
169 170
170 // Task factory used for animation timer. 171 // Task factory used for animation timer.
171 base::WeakPtrFactory<SpeechRecognitionBubbleBase> weak_factory_; 172 base::WeakPtrFactory<SpeechRecognitionBubbleBase> weak_factory_;
172 int animation_step_; // Current index/step of the animation. 173 int animation_step_; // Current index/step of the animation.
173 std::vector<gfx::ImageSkia> animation_frames_;
174 std::vector<gfx::ImageSkia> warming_up_frames_;
175 174
176 DisplayMode display_mode_; 175 DisplayMode display_mode_;
177 string16 message_text_; // Text displayed in DISPLAY_MODE_MESSAGE 176 string16 message_text_; // Text displayed in DISPLAY_MODE_MESSAGE
177
178 // The current microphone image with volume level indication. 178 // The current microphone image with volume level indication.
179 scoped_ptr<SkBitmap> mic_image_; 179 scoped_ptr<SkBitmap> mic_image_;
180 // A temporary buffer image used in creating the above mic image. 180 // A temporary buffer image used in creating the above mic image.
181 scoped_ptr<SkBitmap> buffer_image_; 181 scoped_ptr<SkBitmap> buffer_image_;
182 // WebContents in which this this bubble gets displayed. 182 // WebContents in which this this bubble gets displayed.
183 content::WebContents* web_contents_; 183 content::WebContents* web_contents_;
184 // The current image displayed in the bubble's icon widget. 184 // The current image displayed in the bubble's icon widget.
185 scoped_ptr<gfx::ImageSkia> icon_image_; 185 scoped_ptr<gfx::ImageSkia> icon_image_;
186 // The scale factor used for the web-contents.
187 ui::ScaleFactor scale_factor_;
188
189 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionBubbleBase);
186 }; 190 };
187 191
188 // This typedef is to workaround the issue with certain versions of 192 // This typedef is to workaround the issue with certain versions of
189 // Visual Studio where it gets confused between multiple Delegate 193 // Visual Studio where it gets confused between multiple Delegate
190 // classes and gives a C2500 error. (I saw this error on the try bots - 194 // classes and gives a C2500 error. (I saw this error on the try bots -
191 // the workaround was not needed for my machine). 195 // the workaround was not needed for my machine).
192 typedef SpeechRecognitionBubble::Delegate SpeechRecognitionBubbleDelegate; 196 typedef SpeechRecognitionBubble::Delegate SpeechRecognitionBubbleDelegate;
193 197
194 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_ 198 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_BUBBLE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/speech/speech_recognition_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698