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

Side by Side Diff: ui/gfx/native_theme_aura.cc

Issue 8520026: Fix statics in NativeTheme*::instance() to avoid destruction post main (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « ui/gfx/native_theme_android.cc ('k') | ui/gfx/native_theme_chromeos.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) 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 "ui/gfx/native_theme_aura.h" 5 #include "ui/gfx/native_theme_aura.h"
6 6
7 #include "base/basictypes.h"
7 #include "grit/gfx_resources.h" 8 #include "grit/gfx_resources.h"
8 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
10 #include "ui/gfx/skbitmap_operations.h" 11 #include "ui/gfx/skbitmap_operations.h"
11 12
12 namespace { 13 namespace {
13 14
14 const SkColor kMenuBackgroundColor = SkColorSetRGB(0xed, 0xed, 0xed); 15 const SkColor kMenuBackgroundColor = SkColorSetRGB(0xed, 0xed, 0xed);
15 16
16 } // namespace 17 } // namespace
17 18
18 namespace gfx { 19 namespace gfx {
19 20
20 // static 21 // static
21 const NativeTheme* NativeTheme::instance() { 22 const NativeTheme* NativeTheme::instance() {
22 return NativeThemeAura::instance(); 23 return NativeThemeAura::instance();
23 } 24 }
24 25
25 // static 26 // static
26 const NativeThemeAura* NativeThemeAura::instance() { 27 const NativeThemeAura* NativeThemeAura::instance() {
27 static const NativeThemeAura s_native_theme; 28 CR_DEFINE_STATIC_LOCAL(NativeThemeAura, s_native_theme, ());
28 return &s_native_theme; 29 return &s_native_theme;
29 } 30 }
30 31
31 NativeThemeAura::NativeThemeAura() { 32 NativeThemeAura::NativeThemeAura() {
32 } 33 }
33 34
34 NativeThemeAura::~NativeThemeAura() { 35 NativeThemeAura::~NativeThemeAura() {
35 } 36 }
36 37
37 void NativeThemeAura::PaintMenuPopupBackground( 38 void NativeThemeAura::PaintMenuPopupBackground(
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 SkBitmapOperations::CreateTransposedBtmap(*vertical_bitmap); 168 SkBitmapOperations::CreateTransposedBtmap(*vertical_bitmap);
168 SkBitmap* horizontal_bitmap = new SkBitmap(transposed_bitmap); 169 SkBitmap* horizontal_bitmap = new SkBitmap(transposed_bitmap);
169 170
170 horizontal_bitmaps_[resource_id] = horizontal_bitmap; 171 horizontal_bitmaps_[resource_id] = horizontal_bitmap;
171 return horizontal_bitmap; 172 return horizontal_bitmap;
172 } 173 }
173 return NULL; 174 return NULL;
174 } 175 }
175 176
176 } // namespace gfx 177 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/native_theme_android.cc ('k') | ui/gfx/native_theme_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698