Chromium Code Reviews| Index: third_party/WebKit/Source/platform/Widget.cpp |
| diff --git a/third_party/WebKit/Source/platform/Widget.cpp b/third_party/WebKit/Source/platform/Widget.cpp |
| index b4aa2afa43a83079c89ecb19088a0e6c9b0d2a70..e23bf9570b22ebbdb76cc0feb5ce11705f00d7b4 100644 |
| --- a/third_party/WebKit/Source/platform/Widget.cpp |
| +++ b/third_party/WebKit/Source/platform/Widget.cpp |
| @@ -27,6 +27,7 @@ |
| #include "platform/Widget.h" |
| #include "wtf/Assertions.h" |
| +#include "wtf/text/WTFString.h" |
|
fs
2016/05/23 21:25:56
Hmm?
|
| namespace blink { |
| @@ -66,6 +67,20 @@ Widget* Widget::root() const |
| return 0; |
| } |
| +bool Widget::resize(int w, int h) |
| +{ |
| + return resize(IntSize(w, h)); |
| +} |
| + |
| +bool Widget::resize(const IntSize& s) |
| +{ |
| + IntRect newFrameRect(IntRect(location(), s)); |
|
fs
2016/05/23 21:25:56
newFrameRect(location(), s);
Could also just comp
|
| + if (newFrameRect == frameRect()) |
| + return false; |
| + setFrameRect(newFrameRect); |
| + return true; |
| +} |
| + |
| IntRect Widget::convertFromRootFrame(const IntRect& rectInRootFrame) const |
| { |
| if (const Widget* parentWidget = parent()) { |