OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 #include "core/page/Page.h" | 51 #include "core/page/Page.h" |
52 #include "core/rendering/HitTestResult.h" | 52 #include "core/rendering/HitTestResult.h" |
53 #include "core/rendering/RenderPart.h" | 53 #include "core/rendering/RenderPart.h" |
54 #include "core/rendering/compositing/CompositedSelectionBound.h" | 54 #include "core/rendering/compositing/CompositedSelectionBound.h" |
55 #include "modules/accessibility/AXObject.h" | 55 #include "modules/accessibility/AXObject.h" |
56 #include "platform/Cursor.h" | 56 #include "platform/Cursor.h" |
57 #include "platform/FileChooser.h" | 57 #include "platform/FileChooser.h" |
58 #include "platform/PlatformScreen.h" | 58 #include "platform/PlatformScreen.h" |
59 #include "platform/RuntimeEnabledFeatures.h" | 59 #include "platform/RuntimeEnabledFeatures.h" |
60 #include "platform/exported/WrappedResourceRequest.h" | 60 #include "platform/exported/WrappedResourceRequest.h" |
61 #include "platform/geometry/FloatRect.h" | |
62 #include "platform/geometry/IntRect.h" | 61 #include "platform/geometry/IntRect.h" |
63 #include "platform/graphics/GraphicsLayer.h" | 62 #include "platform/graphics/GraphicsLayer.h" |
64 #include "platform/weborigin/SecurityOrigin.h" | 63 #include "platform/weborigin/SecurityOrigin.h" |
65 #include "public/platform/Platform.h" | 64 #include "public/platform/Platform.h" |
66 #include "public/platform/WebCursorInfo.h" | 65 #include "public/platform/WebCursorInfo.h" |
67 #include "public/platform/WebRect.h" | 66 #include "public/platform/WebRect.h" |
68 #include "public/platform/WebSelectionBound.h" | 67 #include "public/platform/WebSelectionBound.h" |
69 #include "public/platform/WebURLRequest.h" | 68 #include "public/platform/WebURLRequest.h" |
70 #include "public/web/WebAXObject.h" | 69 #include "public/web/WebAXObject.h" |
71 #include "public/web/WebAutofillClient.h" | 70 #include "public/web/WebAutofillClient.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 void* ChromeClientImpl::webView() const | 137 void* ChromeClientImpl::webView() const |
139 { | 138 { |
140 return static_cast<void*>(m_webView); | 139 return static_cast<void*>(m_webView); |
141 } | 140 } |
142 | 141 |
143 void ChromeClientImpl::chromeDestroyed() | 142 void ChromeClientImpl::chromeDestroyed() |
144 { | 143 { |
145 // Our lifetime is bound to the WebViewImpl. | 144 // Our lifetime is bound to the WebViewImpl. |
146 } | 145 } |
147 | 146 |
148 void ChromeClientImpl::setWindowRect(const FloatRect& r) | 147 void ChromeClientImpl::setWindowRect(const IntRect& r) |
149 { | 148 { |
150 if (m_webView->client()) | 149 if (m_webView->client()) |
151 m_webView->client()->setWindowRect(IntRect(r)); | 150 m_webView->client()->setWindowRect(r); |
152 } | 151 } |
153 | 152 |
154 FloatRect ChromeClientImpl::windowRect() | 153 IntRect ChromeClientImpl::windowRect() |
155 { | 154 { |
156 WebRect rect; | 155 WebRect rect; |
157 if (m_webView->client()) | 156 if (m_webView->client()) |
158 rect = m_webView->client()->rootWindowRect(); | 157 rect = m_webView->client()->rootWindowRect(); |
159 else { | 158 else { |
160 // These numbers will be fairly wrong. The window's x/y coordinates will | 159 // These numbers will be fairly wrong. The window's x/y coordinates will |
161 // be the top left corner of the screen and the size will be the content | 160 // be the top left corner of the screen and the size will be the content |
162 // size instead of the window size. | 161 // size instead of the window size. |
163 rect.width = m_webView->size().width; | 162 rect.width = m_webView->size().width; |
164 rect.height = m_webView->size().height; | 163 rect.height = m_webView->size().height; |
165 } | 164 } |
166 return FloatRect(rect); | 165 return IntRect(rect); |
167 } | 166 } |
168 | 167 |
169 FloatRect ChromeClientImpl::pageRect() | 168 IntRect ChromeClientImpl::pageRect() |
170 { | 169 { |
171 // We hide the details of the window's border thickness from the web page by | 170 // We hide the details of the window's border thickness from the web page by |
172 // simple re-using the window position here. So, from the point-of-view of | 171 // simple re-using the window position here. So, from the point-of-view of |
173 // the web page, the window has no border. | 172 // the web page, the window has no border. |
174 return windowRect(); | 173 return windowRect(); |
Jens Widell
2015/01/28 12:29:55
This seems to be the only implementation of pageRe
| |
175 } | 174 } |
176 | 175 |
177 void ChromeClientImpl::focus() | 176 void ChromeClientImpl::focus() |
178 { | 177 { |
179 if (m_webView->client()) | 178 if (m_webView->client()) |
180 m_webView->client()->didFocus(); | 179 m_webView->client()->didFocus(); |
181 } | 180 } |
182 | 181 |
183 bool ChromeClientImpl::canTakeFocus(WebFocusType) | 182 bool ChromeClientImpl::canTakeFocus(WebFocusType) |
184 { | 183 { |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
882 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu t)); | 881 webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&inpu t)); |
883 } | 882 } |
884 | 883 |
885 void ChromeClientImpl::registerViewportLayers() const | 884 void ChromeClientImpl::registerViewportLayers() const |
886 { | 885 { |
887 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie w->pinchVirtualViewportEnabled()) | 886 if (m_webView->rootGraphicsLayer() && m_webView->layerTreeView() && m_webVie w->pinchVirtualViewportEnabled()) |
888 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie w(m_webView->layerTreeView()); | 887 m_webView->page()->frameHost().pinchViewport().registerLayersWithTreeVie w(m_webView->layerTreeView()); |
889 } | 888 } |
890 | 889 |
891 } // namespace blink | 890 } // namespace blink |
OLD | NEW |