Index: chrome/renderer/renderer_webkitclient_impl.cc |
=================================================================== |
--- chrome/renderer/renderer_webkitclient_impl.cc (revision 75719) |
+++ chrome/renderer/renderer_webkitclient_impl.cc (working copy) |
@@ -28,6 +28,7 @@ |
#include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" |
#include "chrome/renderer/websharedworkerrepository_impl.h" |
#include "googleurl/src/gurl.h" |
+#include "grit/common_resources.h" |
#include "ipc/ipc_sync_message_filter.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
@@ -242,6 +243,34 @@ |
url, response_time, copy)); |
} |
+WebKit::WebData RendererWebKitClientImpl::loadResource(const char* name) { |
+ struct { |
+ const char* name; |
+ int id; |
+ } resources[] = { |
+ { "americanExpressCC", IDR_AUTOFILL_CC_AMEX }, |
+ { "dinersCC", IDR_AUTOFILL_CC_DINERS }, |
+ { "discoverCC", IDR_AUTOFILL_CC_DISCOVER }, |
+ { "genericCC", IDR_AUTOFILL_CC_GENERIC }, |
+ { "jcbCC", IDR_AUTOFILL_CC_JCB }, |
+ { "masterCardCC", IDR_AUTOFILL_CC_MASTERCARD }, |
+ { "soloCC", IDR_AUTOFILL_CC_SOLO }, |
+ { "visaCC", IDR_AUTOFILL_CC_VISA }, |
+ }; |
+ |
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(resources); ++i) { |
+ if (!strcmp(name, resources[i].name)) { |
+ base::StringPiece resource = |
+ webkit_glue::GetDataResource(resources[i].id); |
+ return WebKit::WebData(resource.data(), resource.size()); |
+ } |
+ } |
+ |
+ // The resource in webkit/glue/webkit_resources.grd can be only loaded by |
+ // WebClientImpl class. |
+ return webkit_glue::WebKitClientImpl::loadResource(name); |
+} |
+ |
WebString RendererWebKitClientImpl::defaultLocale() { |
// TODO(darin): Eliminate this webkit_glue call. |
return ASCIIToUTF16(webkit_glue::GetWebKitLocale()); |