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

Unified Diff: webkit/glue/plugins/pepper_private.cc

Issue 3035005: Add private Pepper v2 API to get localized strings. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
Index: webkit/glue/plugins/pepper_private.cc
===================================================================
--- webkit/glue/plugins/pepper_private.cc (revision 0)
+++ webkit/glue/plugins/pepper_private.cc (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "build/build_config.h"
+
+#include "webkit/glue/plugins/pepper_private.h"
+
+#include "base/utf_string_conversions.h"
+#include "grit/webkit_strings.h"
+#include "webkit/glue/webkit_glue.h"
+#include "webkit/glue/plugins/pepper_var.h"
+#include "webkit/glue/plugins/ppb_private.h"
+
+namespace pepper {
+
+namespace {
+
+PP_Var GetLocalizedString(PP_ResourceString string_id) {
+ std::string rv;
+ if (string_id == PPB_RESOURCE_STRING_PDF_GET_PASSWORD)
+ rv = UTF16ToUTF8(webkit_glue::GetLocalizedString(IDS_PDF_NEED_PASSWORD));
+
+ return StringToPPVar(rv);
+}
+
+const PPB_Private ppb_private = {
+ &GetLocalizedString,
+};
+
+} // namespace
+
+// static
+const PPB_Private* Private::GetInterface() {
+ return &ppb_private;
+}
+
+} // namespace pepper
Property changes on: webkit\glue\plugins\pepper_private.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698