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

Side by Side Diff: chrome/browser/speech/speech_input_bubble.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix CrOS Created 9 years, 1 month 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
OLDNEW
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
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 = LINKER_ZERO_INITIALIZED;
102 102
103 } // namespace 103 } // namespace
104 104
105 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL; 105 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL;
106 const int SpeechInputBubble::kBubbleTargetOffsetX = 10; 106 const int SpeechInputBubble::kBubbleTargetOffsetX = 10;
107 107
108 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents, 108 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents,
109 Delegate* delegate, 109 Delegate* delegate,
110 const gfx::Rect& element_rect) { 110 const gfx::Rect& element_rect) {
111 if (factory_) 111 if (factory_)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 237
238 void SpeechInputBubbleBase::SetImage(const SkBitmap& image) { 238 void SpeechInputBubbleBase::SetImage(const SkBitmap& image) {
239 icon_image_.reset(new SkBitmap(image)); 239 icon_image_.reset(new SkBitmap(image));
240 UpdateImage(); 240 UpdateImage();
241 } 241 }
242 242
243 SkBitmap SpeechInputBubbleBase::icon_image() { 243 SkBitmap SpeechInputBubbleBase::icon_image() {
244 return (icon_image_ != NULL) ? *icon_image_ : SkBitmap(); 244 return (icon_image_ != NULL) ? *icon_image_ : SkBitmap();
245 } 245 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698