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

Unified Diff: ui/android/resources/nine_patch_resource.h

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)
Patch Set: jni Created 3 years, 9 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/android/resources/nine_patch_resource.h
diff --git a/ui/android/resources/nine_patch_resource.h b/ui/android/resources/nine_patch_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..11b6502dbc905b9fa2151a1332ad930b736ef29d
--- /dev/null
+++ b/ui/android/resources/nine_patch_resource.h
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_
+#define UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_
+
+#include "ui/android/resources/resource.h"
+#include "ui/android/ui_android_export.h"
+#include "ui/gfx/geometry/insets_f.h"
+
+namespace ui {
+
+class UI_ANDROID_EXPORT NinePatchResource final : public Resource {
+ public:
+ static NinePatchResource* From(Resource* resource);
+
+ NinePatchResource(gfx::Rect padding, gfx::Rect aperture);
+ ~NinePatchResource() override;
+
+ std::unique_ptr<Resource> CreateForCopy() override;
+
+ gfx::Rect Border(const gfx::Size& bounds) const;
+ gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale) const;
+
+ gfx::Rect padding() const { return padding_; }
+ gfx::Rect aperture() const { return aperture_; }
+
+ private:
+ const gfx::Rect padding_;
+ const gfx::Rect aperture_;
+};
+
+} // namespace ui
+
+#endif // UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_
« no previous file with comments | « ui/android/java/src/org/chromium/ui/resources/statics/StaticResource.java ('k') | ui/android/resources/nine_patch_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698