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

Unified Diff: chrome/browser/extensions/api/resources_private/resources_private_api.cc

Issue 1329213002: PDF: Use chrome.resourcesPrivate instead of Pepper to display translated strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i18n_api
Patch Set: Remove test cases Created 5 years, 3 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/browser/extensions/DEPS ('k') | chrome/browser/resources/pdf/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/resources_private/resources_private_api.cc
diff --git a/chrome/browser/extensions/api/resources_private/resources_private_api.cc b/chrome/browser/extensions/api/resources_private/resources_private_api.cc
index a4b720e8ad4808b0c0dfb39cfc9c56e94b494611..bfaa40f7f400f3c49a414b282cb953404dc6713b 100644
--- a/chrome/browser/extensions/api/resources_private/resources_private_api.cc
+++ b/chrome/browser/extensions/api/resources_private/resources_private_api.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/common/extensions/api/resources_private.h"
#include "chrome/grit/generated_resources.h"
+#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h"
@@ -28,6 +29,15 @@ void AddStringsForIdentity(base::DictionaryValue* dict) {
l10n_util::GetStringUTF16(IDS_EXTENSION_CONFIRM_PERMISSIONS));
}
+void AddStringsForPdf(base::DictionaryValue* dict) {
+ dict->SetString("passwordPrompt",
+ l10n_util::GetStringUTF16(IDS_PDF_NEED_PASSWORD));
+ dict->SetString("pageLoading",
+ l10n_util::GetStringUTF16(IDS_PDF_PAGE_LOADING));
+ dict->SetString("pageLoadFailed",
+ l10n_util::GetStringUTF16(IDS_PDF_PAGE_LOAD_FAILED));
+}
+
} // namespace
namespace get_strings = api::resources_private::GetStrings;
@@ -46,6 +56,9 @@ ExtensionFunction::ResponseAction ResourcesPrivateGetStringsFunction::Run() {
case api::resources_private::COMPONENT_IDENTITY:
AddStringsForIdentity(dict.get());
break;
+ case api::resources_private::COMPONENT_PDF:
+ AddStringsForPdf(dict.get());
+ break;
case api::resources_private::COMPONENT_NONE:
NOTREACHED();
}
« no previous file with comments | « chrome/browser/extensions/DEPS ('k') | chrome/browser/resources/pdf/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698