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

Unified Diff: mojo/converters/geometry/geometry_type_converters.cc

Issue 1419793006: Makes windowmanager draw non-client area (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add include Created 5 years, 1 month 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
« no previous file with comments | « mojo/converters/geometry/geometry_type_converters.h ('k') | ui/mojo/geometry/geometry.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/converters/geometry/geometry_type_converters.cc
diff --git a/mojo/converters/geometry/geometry_type_converters.cc b/mojo/converters/geometry/geometry_type_converters.cc
index 00f4f3430c9b242ebe3523cc0fe4ece1561a39eb..c918d01a7240e428a8b2cee3423f386ad8b57aaa 100644
--- a/mojo/converters/geometry/geometry_type_converters.cc
+++ b/mojo/converters/geometry/geometry_type_converters.cc
@@ -115,4 +115,39 @@ gfx::Size TypeConverter<gfx::Size, Size>::Convert(const Size& input) {
return gfx::Size(input.width, input.height);
}
+// static
+Insets TypeConverter<Insets, gfx::Insets>::Convert(const gfx::Insets& input) {
+ Insets insets;
+ insets.top = input.top();
+ insets.left = input.left();
+ insets.bottom = input.bottom();
+ insets.right = input.right();
+ return insets;
+}
+
+// static
+gfx::Insets TypeConverter<gfx::Insets, Insets>::Convert(const Insets& input) {
+ return gfx::Insets(input.top, input.left, input.bottom, input.right);
+}
+
+// static
+InsetsPtr TypeConverter<InsetsPtr, gfx::Insets>::Convert(
+ const gfx::Insets& input) {
+ InsetsPtr insets(Insets::New());
+ insets->top = input.top();
+ insets->left = input.left();
+ insets->bottom = input.bottom();
+ insets->right = input.right();
+ return insets.Pass();
+}
+
+// static
+gfx::Insets TypeConverter<gfx::Insets, InsetsPtr>::Convert(
+ const InsetsPtr& input) {
+ if (input.is_null())
+ return gfx::Insets();
+
+ return gfx::Insets(input->top, input->left, input->bottom, input->right);
+}
+
} // namespace mojo
« no previous file with comments | « mojo/converters/geometry/geometry_type_converters.h ('k') | ui/mojo/geometry/geometry.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698