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

Unified Diff: ui/gfx/native_theme_chromeos.cc

Issue 7778036: ui/gfx: Get rid of a few static variables from NativeTheme* type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use base::LazyInstance Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/native_theme_chromeos.h ('k') | ui/gfx/native_theme_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/native_theme_chromeos.cc
diff --git a/ui/gfx/native_theme_chromeos.cc b/ui/gfx/native_theme_chromeos.cc
index a12b45f9eb8b43c3497a111e40f35d83079f7bb7..5c1fc11e0785df85e5f472d84b11620f71d820e2 100644
--- a/ui/gfx/native_theme_chromeos.cc
+++ b/ui/gfx/native_theme_chromeos.cc
@@ -4,12 +4,13 @@
#include "ui/gfx/native_theme_chromeos.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "grit/gfx_resources.h"
-#include "third_party/skia/include/effects/SkGradientShader.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/core/SkShader.h"
+#include "third_party/skia/include/effects/SkGradientShader.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/rect.h"
@@ -230,11 +231,12 @@ void GetRadioIndicatorGradientPaint(const gfx::Rect bounds,
} // namespace
-/* static */
+base::LazyInstance<gfx::NativeThemeLinux> g_native_theme(
+ base::LINKER_INITIALIZED);
+
+// static
const gfx::NativeThemeLinux* gfx::NativeThemeLinux::instance() {
- // The global NativeThemeChromeos instance.
- static NativeThemeChromeos s_native_theme;
- return &s_native_theme;
+ return g_native_theme.Pointer();
}
NativeThemeChromeos::NativeThemeChromeos() {
« no previous file with comments | « ui/gfx/native_theme_chromeos.h ('k') | ui/gfx/native_theme_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698