| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/speech/speech_input_bubble.h" | 8 #include "chrome/browser/speech/speech_input_bubble.h" |
| 9 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 SkBitmap frame_copy; | 91 SkBitmap frame_copy; |
| 92 frame.copyTo(&frame_copy, SkBitmap::kARGB_8888_Config); | 92 frame.copyTo(&frame_copy, SkBitmap::kARGB_8888_Config); |
| 93 spinner_.push_back(frame_copy); | 93 spinner_.push_back(frame_copy); |
| 94 | 94 |
| 95 // The warm up spinner animation is a gray scale version of the real one. | 95 // The warm up spinner animation is a gray scale version of the real one. |
| 96 warm_up_.push_back(SkBitmapOperations::CreateHSLShiftedBitmap( | 96 warm_up_.push_back(SkBitmapOperations::CreateHSLShiftedBitmap( |
| 97 frame_copy, kGrayscaleShift)); | 97 frame_copy, kGrayscaleShift)); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 base::LazyInstance<SpeechInputBubbleImages> g_images(base::LINKER_INITIALIZED); | 101 base::LazyInstance<SpeechInputBubbleImages> g_images = |
| 102 LAZY_INSTANCE_INITIALIZER; |
| 102 | 103 |
| 103 } // namespace | 104 } // namespace |
| 104 | 105 |
| 105 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL; | 106 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL; |
| 106 const int SpeechInputBubble::kBubbleTargetOffsetX = 10; | 107 const int SpeechInputBubble::kBubbleTargetOffsetX = 10; |
| 107 | 108 |
| 108 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents, | 109 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents, |
| 109 Delegate* delegate, | 110 Delegate* delegate, |
| 110 const gfx::Rect& element_rect) { | 111 const gfx::Rect& element_rect) { |
| 111 if (factory_) | 112 if (factory_) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 237 } |
| 237 | 238 |
| 238 void SpeechInputBubbleBase::SetImage(const SkBitmap& image) { | 239 void SpeechInputBubbleBase::SetImage(const SkBitmap& image) { |
| 239 icon_image_.reset(new SkBitmap(image)); | 240 icon_image_.reset(new SkBitmap(image)); |
| 240 UpdateImage(); | 241 UpdateImage(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 SkBitmap SpeechInputBubbleBase::icon_image() { | 244 SkBitmap SpeechInputBubbleBase::icon_image() { |
| 244 return (icon_image_ != NULL) ? *icon_image_ : SkBitmap(); | 245 return (icon_image_ != NULL) ? *icon_image_ : SkBitmap(); |
| 245 } | 246 } |
| OLD | NEW |