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

Unified Diff: chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc

Issue 1126383003: Add strings for webstore widget app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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/app/chromeos_strings.grdp ('k') | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc b/chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc
index 6c149a563311f2053c549aaaa64a7cbcb618cce9..058cb8cb9a913000e899bf6d9f296b659a7f18f0 100644
--- a/chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_widget_private/webstore_widget_private_api.cc
@@ -6,17 +6,28 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chrome/browser/extensions/api/webstore_widget_private/app_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/webstore_widget_private.h"
+#include "chrome/grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/webui/web_ui_util.h"
+
+namespace extensions {
+namespace api {
namespace {
+
const char kGoogleCastApiExtensionId[] = "mafeflapfdfljijmlienjedomfjfmhpd";
-} // namespace
-namespace extensions {
-namespace api {
+void SetL10nString(base::DictionaryValue* dict, const std::string& string_id,
+ int resource_id) {
+ dict->SetString(string_id, l10n_util::GetStringUTF16(resource_id));
+}
+
+} // namespace
WebstoreWidgetPrivateGetStringsFunction::
WebstoreWidgetPrivateGetStringsFunction() {
@@ -29,6 +40,19 @@ WebstoreWidgetPrivateGetStringsFunction::
ExtensionFunction::ResponseAction
WebstoreWidgetPrivateGetStringsFunction::Run() {
base::DictionaryValue* dict = new base::DictionaryValue();
+
+ SetL10nString(dict, "TITLE_PRINTER_PROVIDERS",
+ IDS_WEBSTORE_WIDGET_TITLE_PRINTER_PROVIDERS);
+ SetL10nString(dict, "DEFAULT_ERROR_MESSAGE",
+ IDS_WEBSTORE_WIDGET_DEFAULT_ERROR);
+ SetL10nString(dict, "OK_BUTTON", IDS_FILE_BROWSER_OK_LABEL);
+ SetL10nString(dict, "INSTALLATION_FAILED_MESSAGE",
+ IDS_FILE_BROWSER_SUGGEST_DIALOG_INSTALLATION_FAILED);
+ SetL10nString(dict, "LINK_TO_WEBSTORE",
+ IDS_FILE_BROWSER_SUGGEST_DIALOG_LINK_TO_WEBSTORE);
+
+ const std::string& app_locale = g_browser_process->GetApplicationLocale();
+ webui::SetLoadTimeDataDefaults(app_locale, dict);
return RespondNow(OneArgument(dict));
}
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698