| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "core/frame/FrameHost.h" | 31 #include "core/frame/FrameHost.h" |
| 32 #include "core/frame/FrameView.h" | 32 #include "core/frame/FrameView.h" |
| 33 #include "core/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
| 34 #include "core/frame/Settings.h" | 34 #include "core/frame/Settings.h" |
| 35 #include "core/inspector/InspectorInstrumentation.h" | 35 #include "core/inspector/InspectorInstrumentation.h" |
| 36 #include "core/page/ChromeClient.h" | 36 #include "core/page/ChromeClient.h" |
| 37 #include "public/platform/WebScreenInfo.h" | 37 #include "public/platform/WebScreenInfo.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 Screen::Screen(LocalFrame* frame) : ContextClient(frame) {} | 41 Screen::Screen(LocalFrame* frame) : DOMWindowClient(frame) {} |
| 42 | 42 |
| 43 int Screen::height() const { | 43 int Screen::height() const { |
| 44 if (!frame()) | 44 if (!frame()) |
| 45 return 0; | 45 return 0; |
| 46 FrameHost* host = frame()->host(); | 46 FrameHost* host = frame()->host(); |
| 47 if (!host) | 47 if (!host) |
| 48 return 0; | 48 return 0; |
| 49 if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) { | 49 if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) { |
| 50 WebScreenInfo screenInfo = host->chromeClient().screenInfo(); | 50 WebScreenInfo screenInfo = host->chromeClient().screenInfo(); |
| 51 return lroundf(screenInfo.rect.height * screenInfo.deviceScaleFactor); | 51 return lroundf(screenInfo.rect.height * screenInfo.deviceScaleFactor); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 return 0; | 128 return 0; |
| 129 if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) { | 129 if (host->settings().getReportScreenSizeInPhysicalPixelsQuirk()) { |
| 130 WebScreenInfo screenInfo = host->chromeClient().screenInfo(); | 130 WebScreenInfo screenInfo = host->chromeClient().screenInfo(); |
| 131 return lroundf(screenInfo.availableRect.width * | 131 return lroundf(screenInfo.availableRect.width * |
| 132 screenInfo.deviceScaleFactor); | 132 screenInfo.deviceScaleFactor); |
| 133 } | 133 } |
| 134 return host->chromeClient().screenInfo().availableRect.width; | 134 return host->chromeClient().screenInfo().availableRect.width; |
| 135 } | 135 } |
| 136 | 136 |
| 137 DEFINE_TRACE(Screen) { | 137 DEFINE_TRACE(Screen) { |
| 138 ContextClient::trace(visitor); | 138 DOMWindowClient::trace(visitor); |
| 139 Supplementable<Screen>::trace(visitor); | 139 Supplementable<Screen>::trace(visitor); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |