| Index: ui/gfx/geometry/size.cc
|
| diff --git a/ui/gfx/geometry/size.cc b/ui/gfx/geometry/size.cc
|
| index d916ebdadd3c94b2449060a10d7b36baf673d023..03aa69660190df7f7eb10b65cdf625bd1c7df8e6 100644
|
| --- a/ui/gfx/geometry/size.cc
|
| +++ b/ui/gfx/geometry/size.cc
|
| @@ -6,12 +6,29 @@
|
|
|
| #if defined(OS_WIN)
|
| #include <windows.h>
|
| +#elif defined(OS_IOS)
|
| +#include <CoreGraphics/CoreGraphics.h>
|
| +#elif defined(OS_MACOSX)
|
| +#include <ApplicationServices/ApplicationServices.h>
|
| #endif
|
|
|
| #include "base/strings/stringprintf.h"
|
|
|
| namespace gfx {
|
|
|
| +#if defined(OS_MACOSX)
|
| +Size::Size(const CGSize& s)
|
| + : width_(s.width < 0 ? 0 : s.width),
|
| + height_(s.height < 0 ? 0 : s.height) {
|
| +}
|
| +
|
| +Size& Size::operator=(const CGSize& s) {
|
| + set_width(s.width);
|
| + set_height(s.height);
|
| + return *this;
|
| +}
|
| +#endif
|
| +
|
| #if defined(OS_WIN)
|
| SIZE Size::ToSIZE() const {
|
| SIZE s;
|
| @@ -19,13 +36,9 @@ SIZE Size::ToSIZE() const {
|
| s.cy = height();
|
| return s;
|
| }
|
| -#endif
|
| -
|
| -#if defined(OS_MACOSX)
|
| -Size& Size::operator=(const CGSize& s) {
|
| - set_width(s.width);
|
| - set_height(s.height);
|
| - return *this;
|
| +#elif defined(OS_MACOSX)
|
| +CGSize Size::ToCGSize() const {
|
| + return CGSizeMake(width(), height());
|
| }
|
| #endif
|
|
|
|
|