| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file provides the embedder's side of random webkit glue functions. | 5 // This file provides the embedder's side of random webkit glue functions. |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <wininet.h> | 8 #include <wininet.h> |
| 9 | 9 |
| 10 #include "base/clipboard.h" | 10 #include "base/clipboard.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont)); | 245 return RenderThread::current()->Send(new ViewHostMsg_LoadFont(logfont)); |
| 246 } | 246 } |
| 247 | 247 |
| 248 webkit_glue::ScreenInfo webkit_glue::GetScreenInfo(gfx::NativeView window) { | 248 webkit_glue::ScreenInfo webkit_glue::GetScreenInfo(gfx::NativeView window) { |
| 249 webkit_glue::ScreenInfo results; | 249 webkit_glue::ScreenInfo results; |
| 250 RenderThread::current()->Send( | 250 RenderThread::current()->Send( |
| 251 new ViewHostMsg_GetScreenInfo(window, &results)); | 251 new ViewHostMsg_GetScreenInfo(window, &results)); |
| 252 return results; | 252 return results; |
| 253 } | 253 } |
| 254 | 254 |
| 255 uint64 webkit_glue::VisitedLinkHash(const char* canonical_url, size_t length) { |
| 256 return RenderThread::current()->visited_link_slave()->ComputeURLFingerprint( |
| 257 canonical_url, length); |
| 258 } |
| 259 |
| 260 bool webkit_glue::IsLinkVisited(uint64 link_hash) { |
| 261 return RenderThread::current()->visited_link_slave()->IsVisited(link_hash); |
| 262 } |
| 263 |
| 255 #ifndef USING_SIMPLE_RESOURCE_LOADER_BRIDGE | 264 #ifndef USING_SIMPLE_RESOURCE_LOADER_BRIDGE |
| 256 | 265 |
| 257 // Each RenderView has a ResourceDispatcher. In unit tests, this function may | 266 // Each RenderView has a ResourceDispatcher. In unit tests, this function may |
| 258 // not work properly since there may be a ResourceDispatcher w/o a RenderView. | 267 // not work properly since there may be a ResourceDispatcher w/o a RenderView. |
| 259 // The WebView's delegate may be null, which typically happens as a WebView is | 268 // The WebView's delegate may be null, which typically happens as a WebView is |
| 260 // being closed (but it is also possible that it could be null at other times | 269 // being closed (but it is also possible that it could be null at other times |
| 261 // since WebView has a SetDelegate method). | 270 // since WebView has a SetDelegate method). |
| 262 static ResourceDispatcher* GetResourceDispatcher(WebFrame* frame) { | 271 static ResourceDispatcher* GetResourceDispatcher(WebFrame* frame) { |
| 263 WebViewDelegate* d = frame->GetView()->GetDelegate(); | 272 WebViewDelegate* d = frame->GetView()->GetDelegate(); |
| 264 return d ? static_cast<RenderView*>(d)->resource_dispatcher() : NULL; | 273 return d ? static_cast<RenderView*>(d)->resource_dispatcher() : NULL; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // NOTE: Since this can be called from the plugin process, we might not have | 321 // NOTE: Since this can be called from the plugin process, we might not have |
| 313 // a RenderThread. Do nothing in that case. | 322 // a RenderThread. Do nothing in that case. |
| 314 if (RenderThread::current()) | 323 if (RenderThread::current()) |
| 315 RenderThread::current()->InformHostOfCacheStatsLater(); | 324 RenderThread::current()->InformHostOfCacheStatsLater(); |
| 316 } | 325 } |
| 317 | 326 |
| 318 #endif // !USING_SIMPLE_RESOURCE_LOADER_BRIDGE | 327 #endif // !USING_SIMPLE_RESOURCE_LOADER_BRIDGE |
| 319 | 328 |
| 320 } // namespace webkit_glue | 329 } // namespace webkit_glue |
| 321 | 330 |
| OLD | NEW |