Commit c5965213 authored by tbarzic's avatar tbarzic Committed by Commit bot

Add strings for webstore widget app

BUG=477106

Review URL: https://codereview.chromium.org/1126383003

Cr-Commit-Position: refs/heads/master@{#329490}
parent e5d703e7
......@@ -6346,4 +6346,18 @@ All users must sign out to continue.
Read and write access to <ph name="VOLUME_NAME">$1<ex>FooBar 4GB</ex></ph> has been granted.
</message>
<!-- Webstore widget app -->
<message name="IDS_WEBSTORE_WIDGET_APP_NAME" desc="App name for Webstore Gallery Widget app. The app shows a filtered list of extensions from Chrome Web Store. Extensions from the list can be installed directly from the app.">
Chrome Web Store Gallery
</message>
<message name="IDS_WEBSTORE_WIDGET_APP_DESC" desc="Description of Chrome Webstore Gallery Widget app.">
An app that shows a filtered list of extensions from Chrome Web Store. Extensions in the list can be installed directly from the app.
</message>
<message name="IDS_WEBSTORE_WIDGET_TITLE_PRINTER_PROVIDERS" desc="Title for Chrome Web Store Gallery Widget which lists all print driver apps from Chrome Web Store for a specific printer.">
Select a printer driver app
</message>
<message name="IDS_WEBSTORE_WIDGET_DEFAULT_ERROR" desc="Default message shown when Chrome Web Store Widget app window content fails to load (e.g. if it fails to load Chrome Web Store Gallery in a webview).">
Could not connect to the Chrome Web Store.
</message>
</grit-part>
......@@ -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));
}
......
......@@ -331,8 +331,11 @@ void ComponentLoader::AddGalleryExtension() {
void ComponentLoader::AddWebstoreWidgetExtension() {
#if defined(OS_CHROMEOS)
Add(IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST,
base::FilePath(FILE_PATH_LITERAL("webstore_widget")));
AddWithNameAndDescription(
IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST,
base::FilePath(FILE_PATH_LITERAL("webstore_widget")),
IDS_WEBSTORE_WIDGET_APP_NAME,
IDS_WEBSTORE_WIDGET_APP_DESC);
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment