| 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 24 matching lines...) Expand all Loading... |
| 35 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
| 36 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
| 37 #include "platform/PlatformScreen.h" | 37 #include "platform/PlatformScreen.h" |
| 38 #include "platform/geometry/FloatRect.h" | 38 #include "platform/geometry/FloatRect.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 Screen::Screen(LocalFrame* frame) | 42 Screen::Screen(LocalFrame* frame) |
| 43 : DOMWindowProperty(frame) | 43 : DOMWindowProperty(frame) |
| 44 { | 44 { |
| 45 ScriptWrappable::init(this); | |
| 46 } | 45 } |
| 47 | 46 |
| 48 unsigned Screen::height() const | 47 unsigned Screen::height() const |
| 49 { | 48 { |
| 50 if (!m_frame) | 49 if (!m_frame) |
| 51 return 0; | 50 return 0; |
| 52 return static_cast<unsigned>(screenRect(m_frame->view()).height()); | 51 return static_cast<unsigned>(screenRect(m_frame->view()).height()); |
| 53 } | 52 } |
| 54 | 53 |
| 55 unsigned Screen::width() const | 54 unsigned Screen::width() const |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 94 } |
| 96 | 95 |
| 97 unsigned Screen::availWidth() const | 96 unsigned Screen::availWidth() const |
| 98 { | 97 { |
| 99 if (!m_frame) | 98 if (!m_frame) |
| 100 return 0; | 99 return 0; |
| 101 return static_cast<unsigned>(screenAvailableRect(m_frame->view()).width()); | 100 return static_cast<unsigned>(screenAvailableRect(m_frame->view()).width()); |
| 102 } | 101 } |
| 103 | 102 |
| 104 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |