Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / ui / base / default_theme_provider.cc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/base/default_theme_provider.h"
6
7 #include "ui/base/resource/resource_bundle.h"
8 #include "ui/gfx/image/image_skia.h"
9
10 #if defined(OS_WIN) && !defined(USE_AURA)
11 #include "ui/base/win/shell.h"
12 #endif
13
14 namespace ui {
15
16 DefaultThemeProvider::DefaultThemeProvider() {}
17
18 DefaultThemeProvider::~DefaultThemeProvider() {}
19
20 bool DefaultThemeProvider::UsingNativeTheme() const {
21   return true;
22 }
23
24 gfx::ImageSkia* DefaultThemeProvider::GetImageSkiaNamed(int id) const {
25   return ResourceBundle::GetSharedInstance().GetImageSkiaNamed(id);
26 }
27
28 SkColor DefaultThemeProvider::GetColor(int id) const {
29   // Return debugging-blue.
30   return 0xff0000ff;
31 }
32
33 int DefaultThemeProvider::GetDisplayProperty(int id) const {
34   return -1;
35 }
36
37 bool DefaultThemeProvider::ShouldUseNativeFrame() const {
38 #if defined(OS_WIN) && !defined(USE_AURA)
39   return ui::win::IsAeroGlassEnabled();
40 #else
41   return false;
42 #endif
43 }
44
45 bool DefaultThemeProvider::HasCustomImage(int id) const {
46   return false;
47 }
48
49 base::RefCountedMemory* DefaultThemeProvider::GetRawData(
50     int id,
51     ui::ScaleFactor scale_factor) const {
52   return NULL;
53 }
54
55 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(TOOLKIT_VIEWS) && !defined(OS_ANDROID)
56 GdkPixbuf* DefaultThemeProvider::GetRTLEnabledPixbufNamed(int id) const {
57   return NULL;
58 }
59 #endif
60
61 }  // namespace ui