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

Unified Diff: ui/native_theme/native_theme.h

Issue 2591863003: Use nine-patch resource for drawing Aura overlay scrollbar thumb. (Closed)
Patch Set: Addressed sadrul@'s feedback Created 3 years, 10 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
Index: ui/native_theme/native_theme.h
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index b9a7b6969a3e8f258d89cf65f7c49e9f7e765353..7aa469a50b537f2d293d79f5cbd92bfd7f5c76f8 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -11,6 +11,8 @@
#include "cc/paint/paint_canvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/models/menu_separator_types.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/native_theme/native_theme_export.h"
@@ -267,6 +269,20 @@ class NATIVE_THEME_EXPORT NativeTheme {
const gfx::Rect& rect,
ScrollbarOverlayColorTheme theme) const {}
+ // Returns whether the theme uses a nine-patch resource for the given part.
+ // If true, calling code should always paint into a canvas the size of which
+ // can be gotten from GetNinePatchCanvasSize.
+ virtual bool SupportsNinePatch(Part part) const = 0;
+
+ // If the part paints into a nine-patch resource, the size of the canvas
+ // which should be painted into.
+ virtual gfx::Size GetNinePatchCanvasSize(Part part) const = 0;
+
+ // If the part paints into a nine-patch resource, the rect in the canvas
+ // which defines the center tile. This is the tile that should be resized out
+ // when the part is resized.
+ virtual gfx::Rect GetNinePatchAperture(Part part) const = 0;
+
// Supports theme specific colors.
void SetScrollbarColors(unsigned inactive_color,
unsigned active_color,

Powered by Google App Engine
This is Rietveld 408576698