| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "app/resource_bundle.h" | 5 #include "app/resource_bundle.h" |
| 6 #include "chrome/browser/tab_contents/tab_contents.h" | 6 #include "chrome/browser/tab_contents/tab_contents.h" |
| 7 #include "chrome/browser/speech/speech_input_bubble.h" | 7 #include "chrome/browser/speech/speech_input_bubble.h" |
| 8 #include "gfx/canvas_skia.h" | 8 #include "gfx/canvas_skia.h" |
| 9 #include "gfx/rect.h" | 9 #include "gfx/rect.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if (factory_) | 25 if (factory_) |
| 26 return (*factory_)(tab_contents, delegate, element_rect); | 26 return (*factory_)(tab_contents, delegate, element_rect); |
| 27 | 27 |
| 28 // Has the tab already closed before bubble create request was processed? | 28 // Has the tab already closed before bubble create request was processed? |
| 29 if (!tab_contents) | 29 if (!tab_contents) |
| 30 return NULL; | 30 return NULL; |
| 31 | 31 |
| 32 return CreateNativeBubble(tab_contents, delegate, element_rect); | 32 return CreateNativeBubble(tab_contents, delegate, element_rect); |
| 33 } | 33 } |
| 34 | 34 |
| 35 SpeechInputBubbleBase::SpeechInputBubbleBase() | 35 SpeechInputBubbleBase::SpeechInputBubbleBase(TabContents* tab_contents) |
| 36 : ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)), | 36 : ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)), |
| 37 display_mode_(DISPLAY_MODE_RECORDING) { | 37 display_mode_(DISPLAY_MODE_RECORDING), |
| 38 tab_contents_(tab_contents) { |
| 38 if (!mic_empty_) { // Static variables. | 39 if (!mic_empty_) { // Static variables. |
| 39 mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 40 mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 40 IDR_SPEECH_INPUT_MIC_EMPTY); | 41 IDR_SPEECH_INPUT_MIC_EMPTY); |
| 41 mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 42 mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 42 IDR_SPEECH_INPUT_MIC_FULL); | 43 IDR_SPEECH_INPUT_MIC_FULL); |
| 43 mic_mask_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 44 mic_mask_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 44 IDR_SPEECH_INPUT_MIC_MASK); | 45 IDR_SPEECH_INPUT_MIC_MASK); |
| 45 spinner_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 46 spinner_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 46 IDR_SPEECH_INPUT_SPINNER); | 47 IDR_SPEECH_INPUT_SPINNER); |
| 47 } | 48 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 SkPaint multiply_paint; | 142 SkPaint multiply_paint; |
| 142 multiply_paint.setXfermode(SkXfermode::Create(SkXfermode::kMultiply_Mode)); | 143 multiply_paint.setXfermode(SkXfermode::Create(SkXfermode::kMultiply_Mode)); |
| 143 buffer_canvas.drawBitmap(*mic_mask_, 0, clip_top, &multiply_paint); | 144 buffer_canvas.drawBitmap(*mic_mask_, 0, clip_top, &multiply_paint); |
| 144 | 145 |
| 145 // Draw the empty volume image first and the current volume image on top. | 146 // Draw the empty volume image first and the current volume image on top. |
| 146 canvas.drawBitmap(*mic_empty_, 0, 0); | 147 canvas.drawBitmap(*mic_empty_, 0, 0); |
| 147 canvas.drawBitmap(*buffer_image_.get(), 0, 0); | 148 canvas.drawBitmap(*buffer_image_.get(), 0, 0); |
| 148 | 149 |
| 149 SetImage(*mic_image_.get()); | 150 SetImage(*mic_image_.get()); |
| 150 } | 151 } |
| OLD | NEW |