diff options
| author | Grace Kloba <klobag@google.com> | 2010-05-26 14:18:38 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-05-26 14:18:38 -0700 |
| commit | 6df7a6f6621fd9b786d0d5823ca10533c12c2f66 (patch) | |
| tree | 717ef2de6cfbb881afe93b94003712f96b7d9b61 | |
| parent | 9c5d29908efab71c0c545f5fdeff610e2fd4573c (diff) | |
| parent | 299511d537b620ede57a2bff60a8f27d3c935815 (diff) | |
| download | external_webkit-6df7a6f6621fd9b786d0d5823ca10533c12c2f66.zip external_webkit-6df7a6f6621fd9b786d0d5823ca10533c12c2f66.tar.gz external_webkit-6df7a6f6621fd9b786d0d5823ca10533c12c2f66.tar.bz2 | |
Merge "Refix http://b/issue?id=2509597."
| -rw-r--r-- | WebCore/platform/android/ScreenAndroid.cpp | 26 | ||||
| -rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 7 |
2 files changed, 13 insertions, 20 deletions
diff --git a/WebCore/platform/android/ScreenAndroid.cpp b/WebCore/platform/android/ScreenAndroid.cpp index 70cf794..1912a98 100644 --- a/WebCore/platform/android/ScreenAndroid.cpp +++ b/WebCore/platform/android/ScreenAndroid.cpp @@ -62,28 +62,22 @@ bool screenIsMonochrome(Widget* page) return false; } -// The only place I have seen these values used is -// positioning popup windows. If we support multiple windows -// they will be most likely full screen. Therefore, -// the accuracy of these number are not too important. +// This is used by JavaScript Screen object and media query for device info. We +// should return the value in the device pixel. FloatRect screenRect(Widget* page) { - if (!page) - return FloatRect(); - - IntRect rect = page->root()->platformWidget()->getBounds(); - return FloatRect(0.0, 0.0, rect.width(), rect.height()); + android::DisplayInfo info; + android::SurfaceComposerClient::getDisplayInfo(android::DisplayID(0), &info); + return FloatRect(0.0, 0.0, info.w, info.h); } -// Similar screenRect, this function is commonly used by javascripts -// to position and resize windows (usually to full screen). +// Similar as screenRect, this is used by JavaScript Screen object. This is also +// used by JavaScript Window to position and resize (usually to full screen). FloatRect screenAvailableRect(Widget* page) { - if (!page) - return FloatRect(); - - IntRect rect = page->root()->platformWidget()->getBounds(); - return FloatRect(0.0, 0.0, rect.width(), rect.height()); + android::DisplayInfo info; + android::SurfaceComposerClient::getDisplayInfo(android::DisplayID(0), &info); + return FloatRect(0.0, 0.0, info.w, info.h); } } // namespace WebCore diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index ead81e0..c8d9d4b 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -40,7 +40,6 @@ #include "GraphicsLayerAndroid.h" #include "Icon.h" #include "Page.h" -#include "Screen.h" #include "ScriptController.h" #include "WebCoreFrameBridge.h" #include "WebCoreViewBridge.h" @@ -171,10 +170,10 @@ Page* ChromeClientAndroid::createWindow(Frame* frame, const FrameLoadRequest&, return frame->page(); #endif - WTF::PassRefPtr<WebCore::Screen> screen = WebCore::Screen::create(frame); + const WebCoreViewBridge* bridge = frame->view()->platformWidget(); bool dialog = features.dialog || !features.resizable - || (features.heightSet && features.height < screen.get()->height() - && features.widthSet && features.width < screen.get()->width()) + || (features.heightSet && features.height < bridge->height() + && features.widthSet && features.width < bridge->width()) || (!features.menuBarVisible && !features.statusBarVisible && !features.toolBarVisible && !features.locationBarVisible && !features.scrollbarsVisible); |
