OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/renderer/aw_render_view_ext.h" | 5 #include "android_webview/renderer/aw_render_view_ext.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "android_webview/common/aw_hit_test_data.h" | 9 #include "android_webview/common/aw_hit_test_data.h" |
10 #include "android_webview/common/render_view_messages.h" | 10 #include "android_webview/common/render_view_messages.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 bool handled = true; | 160 bool handled = true; |
161 IPC_BEGIN_MESSAGE_MAP(AwRenderViewExt, message) | 161 IPC_BEGIN_MESSAGE_MAP(AwRenderViewExt, message) |
162 IPC_MESSAGE_HANDLER(AwViewMsg_DocumentHasImages, OnDocumentHasImagesRequest) | 162 IPC_MESSAGE_HANDLER(AwViewMsg_DocumentHasImages, OnDocumentHasImagesRequest) |
163 IPC_MESSAGE_HANDLER(AwViewMsg_DoHitTest, OnDoHitTest) | 163 IPC_MESSAGE_HANDLER(AwViewMsg_DoHitTest, OnDoHitTest) |
164 IPC_MESSAGE_HANDLER(AwViewMsg_SetTextZoomFactor, OnSetTextZoomFactor) | 164 IPC_MESSAGE_HANDLER(AwViewMsg_SetTextZoomFactor, OnSetTextZoomFactor) |
165 IPC_MESSAGE_HANDLER(AwViewMsg_ResetScrollAndScaleState, | 165 IPC_MESSAGE_HANDLER(AwViewMsg_ResetScrollAndScaleState, |
166 OnResetScrollAndScaleState) | 166 OnResetScrollAndScaleState) |
167 IPC_MESSAGE_HANDLER(AwViewMsg_SetInitialPageScale, OnSetInitialPageScale) | 167 IPC_MESSAGE_HANDLER(AwViewMsg_SetInitialPageScale, OnSetInitialPageScale) |
168 IPC_MESSAGE_HANDLER(AwViewMsg_SetFixedLayoutSize, OnSetFixedLayoutSize) | 168 IPC_MESSAGE_HANDLER(AwViewMsg_SetFixedLayoutSize, OnSetFixedLayoutSize) |
169 IPC_MESSAGE_HANDLER(AwViewMsg_SetBackgroundColor, OnSetBackgroundColor) | 169 IPC_MESSAGE_HANDLER(AwViewMsg_SetBackgroundColor, OnSetBackgroundColor) |
| 170 IPC_MESSAGE_HANDLER(AwViewMsg_PauseOrResumeGeolocation, |
| 171 OnPauseOrResumeGeolocation) |
170 IPC_MESSAGE_UNHANDLED(handled = false) | 172 IPC_MESSAGE_UNHANDLED(handled = false) |
171 IPC_END_MESSAGE_MAP() | 173 IPC_END_MESSAGE_MAP() |
172 return handled; | 174 return handled; |
173 } | 175 } |
174 | 176 |
175 void AwRenderViewExt::OnDocumentHasImagesRequest(int id) { | 177 void AwRenderViewExt::OnDocumentHasImagesRequest(int id) { |
176 bool hasImages = false; | 178 bool hasImages = false; |
177 if (render_view()) { | 179 if (render_view()) { |
178 blink::WebView* webview = render_view()->GetWebView(); | 180 blink::WebView* webview = render_view()->GetWebView(); |
179 if (webview) { | 181 if (webview) { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 return; | 345 return; |
344 render_view()->GetWebView()->setFixedLayoutSize(size); | 346 render_view()->GetWebView()->setFixedLayoutSize(size); |
345 } | 347 } |
346 | 348 |
347 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { | 349 void AwRenderViewExt::OnSetBackgroundColor(SkColor c) { |
348 if (!render_view() || !render_view()->GetWebView()) | 350 if (!render_view() || !render_view()->GetWebView()) |
349 return; | 351 return; |
350 render_view()->GetWebView()->setBaseBackgroundColor(c); | 352 render_view()->GetWebView()->setBaseBackgroundColor(c); |
351 } | 353 } |
352 | 354 |
| 355 void AwRenderViewExt::OnPauseOrResumeGeolocation(bool should_pause) { |
| 356 if (!render_view() || !render_view()->GetWebView()) |
| 357 return; |
| 358 render_view()->GetWebView()->pauseOrResumeGeolocation(should_pause); |
| 359 } |
| 360 |
353 } // namespace android_webview | 361 } // namespace android_webview |
OLD | NEW |