OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 #ifndef UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_ |
| 6 #define UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_ |
| 7 |
| 8 #include "ui/android/resources/resource.h" |
| 9 #include "ui/android/ui_android_export.h" |
| 10 #include "ui/gfx/geometry/insets_f.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 class UI_ANDROID_EXPORT NinePatchResource final : public Resource { |
| 15 public: |
| 16 static NinePatchResource* From(Resource* resource); |
| 17 |
| 18 NinePatchResource(gfx::Rect padding, gfx::Rect aperture); |
| 19 ~NinePatchResource() override; |
| 20 |
| 21 std::unique_ptr<Resource> CreateForCopy() override; |
| 22 |
| 23 gfx::Rect Border(const gfx::Size& bounds) const; |
| 24 gfx::Rect Border(const gfx::Size& bounds, const gfx::InsetsF& scale) const; |
| 25 |
| 26 gfx::Rect padding() const { return padding_; } |
| 27 gfx::Rect aperture() const { return aperture_; } |
| 28 |
| 29 private: |
| 30 const gfx::Rect padding_; |
| 31 const gfx::Rect aperture_; |
| 32 }; |
| 33 |
| 34 } // namespace ui |
| 35 |
| 36 #endif // UI_ANDROID_RESOURCES_NINE_PATCH_RESOURCE_H_ |
OLD | NEW |