This source file includes following definitions.
- instance
- instance
- GetSystemColor
#include "ui/native_theme/native_theme_gtk.h"
#include <gtk/gtk.h>
#include "base/basictypes.h"
#include "base/logging.h"
#include "ui/gfx/skia_utils_gtk.h"
namespace {
const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE);
const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9);
const SkColor kFocusedMenuItemBackgroundColor = SkColorSetARGB(13, 0, 0, 0);
const SkColor kHoverMenuItemBackgroundColor = SkColorSetRGB(204, 204, 204);
const SkColor kEnabledMenuButtonBorderColor = SkColorSetARGB(36, 0, 0, 0);
const SkColor kFocusedMenuButtonBorderColor = SkColorSetARGB(72, 0, 0, 0);
const SkColor kHoverMenuButtonBorderColor = SkColorSetARGB(72, 0, 0, 0);
const SkColor kButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde);
const SkColor kButtonEnabledColor = SkColorSetRGB(6, 45, 117);
const SkColor kButtonDisabledColor = SkColorSetRGB(161, 161, 146);
const SkColor kButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255);
const SkColor kButtonHoverColor = kButtonEnabledColor;
}
namespace ui {
NativeTheme* NativeTheme::instance() {
return NativeThemeGtk::instance();
}
NativeThemeGtk* NativeThemeGtk::instance() {
CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ());
return &s_native_theme;
}
SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const {
switch (color_id) {
case kColorId_DialogBackground:
return gfx::GdkColorToSkColor(
gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]);
case kColorId_FocusedBorderColor:
return kFocusedBorderColor;
case kColorId_UnfocusedBorderColor:
return kUnfocusedBorderColor;
case kColorId_FocusedMenuItemBackgroundColor:
return kFocusedMenuItemBackgroundColor;
case kColorId_HoverMenuItemBackgroundColor:
return kHoverMenuItemBackgroundColor;
case kColorId_EnabledMenuButtonBorderColor:
return kEnabledMenuButtonBorderColor;
case kColorId_FocusedMenuButtonBorderColor:
return kFocusedMenuButtonBorderColor;
case kColorId_HoverMenuButtonBorderColor:
return kHoverMenuButtonBorderColor;
case kColorId_ButtonBackgroundColor:
return kButtonBackgroundColor;
case kColorId_ButtonEnabledColor:
return kButtonEnabledColor;
case kColorId_ButtonDisabledColor:
return kButtonDisabledColor;
case kColorId_ButtonHighlightColor:
return kButtonHighlightColor;
case kColorId_ButtonHoverColor:
return kButtonHoverColor;
default:
NOTREACHED() << "Invalid color_id: " << color_id;
break;
}
return kInvalidColorIdColor;
}
NativeThemeGtk::NativeThemeGtk() {
}
NativeThemeGtk::~NativeThemeGtk() {
}
}