Don't crash when SimpleCache index is corrupt.
[chromium-blink-merge.git] / ui / native_theme / common_theme.h
blob530032f83908f1ac1db80c725f8716b99d6ae347
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.
5 #ifndef UI_NATIVE_THEME_COMMON_THEME_H_
6 #define UI_NATIVE_THEME_COMMON_THEME_H_
8 #include "ui/native_theme/native_theme.h"
10 class SkCanvas;
12 namespace ui {
14 // Drawing code that is common for all platforms.
16 // Returns true and |color| if |color_id| is found, or false otherwise.
17 bool NATIVE_THEME_EXPORT CommonThemeGetSystemColor(
18 NativeTheme::ColorId color_id,
19 SkColor* color);
21 gfx::Size NATIVE_THEME_EXPORT CommonThemeGetPartSize(
22 NativeTheme::Part part,
23 NativeTheme::State state,
24 const NativeTheme::ExtraParams& extra);
26 void NATIVE_THEME_EXPORT CommonThemePaintMenuSeparator(
27 SkCanvas* canvas,
28 const gfx::Rect& rect,
29 const NativeTheme::MenuSeparatorExtraParams& extra);
31 void NATIVE_THEME_EXPORT CommonThemePaintMenuGutter(SkCanvas* canvas,
32 const gfx::Rect& rect);
34 void NATIVE_THEME_EXPORT CommonThemePaintMenuBackground(SkCanvas* canvas,
35 const gfx::Rect& rect);
37 void NATIVE_THEME_EXPORT CommonThemePaintMenuItemBackground(
38 SkCanvas* canvas,
39 NativeTheme::State state,
40 const gfx::Rect& rect);
42 // Adjust some colors for menu Finch experiments.
43 // |color_id| id of a color to be adjusted.
44 // |color| color before adjustment.
45 // Returns adjusted color.
46 SkColor AdjustColorForMenuVariations(NativeTheme::ColorId color_id,
47 SkColor color);
49 } // namespace ui
51 #endif // UI_NATIVE_THEME_COMMON_THEME_H_