| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #include <wininet.h> | 13 #include <wininet.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "app/resource_bundle.h" | 16 #include "app/resource_bundle.h" |
| 17 #include "base/clipboard.h" | 17 #include "base/clipboard.h" |
| 18 #include "base/scoped_clipboard_writer.h" | 18 #include "base/scoped_clipboard_writer.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
| 22 #include "chrome/common/url_constants.h" |
| 22 #include "chrome/plugin/npobject_util.h" | 23 #include "chrome/plugin/npobject_util.h" |
| 23 #include "chrome/renderer/net/render_dns_master.h" | 24 #include "chrome/renderer/net/render_dns_master.h" |
| 24 #include "chrome/renderer/render_process.h" | 25 #include "chrome/renderer/render_process.h" |
| 25 #include "chrome/renderer/render_thread.h" | 26 #include "chrome/renderer/render_thread.h" |
| 26 #include "googleurl/src/url_util.h" | 27 #include "googleurl/src/url_util.h" |
| 27 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
| 28 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
| 29 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 30 #include "webkit/glue/scoped_clipboard_writer_glue.h" | 31 #include "webkit/glue/scoped_clipboard_writer_glue.h" |
| 31 #include "webkit/glue/webframe.h" | 32 #include "webkit/glue/webframe.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 201 |
| 201 void ClipboardReadAsciiText(std::string* result) { | 202 void ClipboardReadAsciiText(std::string* result) { |
| 202 RenderThread::current()->Send(new ViewHostMsg_ClipboardReadAsciiText(result)); | 203 RenderThread::current()->Send(new ViewHostMsg_ClipboardReadAsciiText(result)); |
| 203 } | 204 } |
| 204 | 205 |
| 205 void ClipboardReadHTML(string16* markup, GURL* url) { | 206 void ClipboardReadHTML(string16* markup, GURL* url) { |
| 206 RenderThread::current()->Send(new ViewHostMsg_ClipboardReadHTML(markup, url)); | 207 RenderThread::current()->Send(new ViewHostMsg_ClipboardReadHTML(markup, url)); |
| 207 } | 208 } |
| 208 | 209 |
| 209 GURL GetInspectorURL() { | 210 GURL GetInspectorURL() { |
| 210 return GURL("chrome-ui://inspector/inspector.html"); | 211 return GURL(std::string(chrome::kChromeUIScheme) + |
| 212 "//inspector/inspector.html"); |
| 211 } | 213 } |
| 212 | 214 |
| 213 std::string GetUIResourceProtocol() { | 215 std::string GetUIResourceProtocol() { |
| 214 return "chrome-ui"; | 216 return "chrome"; |
| 215 } | 217 } |
| 216 | 218 |
| 217 bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { | 219 bool GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { |
| 218 if (!RenderThread::current()->plugin_refresh_allowed()) | 220 if (!RenderThread::current()->plugin_refresh_allowed()) |
| 219 refresh = false; | 221 refresh = false; |
| 220 return RenderThread::current()->Send(new ViewHostMsg_GetPlugins( | 222 return RenderThread::current()->Send(new ViewHostMsg_GetPlugins( |
| 221 refresh, plugins)); | 223 refresh, plugins)); |
| 222 } | 224 } |
| 223 | 225 |
| 224 // static factory function | 226 // static factory function |
| (...skipping 20 matching lines...) Expand all Loading... |
| 245 void NotifyCacheStats() { | 247 void NotifyCacheStats() { |
| 246 // Update the browser about our cache | 248 // Update the browser about our cache |
| 247 // NOTE: Since this can be called from the plugin process, we might not have | 249 // NOTE: Since this can be called from the plugin process, we might not have |
| 248 // a RenderThread. Do nothing in that case. | 250 // a RenderThread. Do nothing in that case. |
| 249 if (!IsPluginProcess()) | 251 if (!IsPluginProcess()) |
| 250 RenderThread::current()->InformHostOfCacheStatsLater(); | 252 RenderThread::current()->InformHostOfCacheStatsLater(); |
| 251 } | 253 } |
| 252 | 254 |
| 253 | 255 |
| 254 } // namespace webkit_glue | 256 } // namespace webkit_glue |
| OLD | NEW |