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 /WebCore/platform/android/ScreenAndroid.cpp | |
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."
Diffstat (limited to 'WebCore/platform/android/ScreenAndroid.cpp')
-rw-r--r-- | WebCore/platform/android/ScreenAndroid.cpp | 26 |
1 files changed, 10 insertions, 16 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 |