Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1319)

Unified Diff: chrome/renderer/renderer_webkitclient_impl.cc

Issue 6516002: Move CC icons to chrome/common and implement loadPlatformResource in RendererWebKitClientImpl. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/renderer_webkitclient_impl.h ('k') | webkit/glue/resources/amex.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/renderer/renderer_webkitclient_impl.h ('k') | webkit/glue/resources/amex.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698