OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extensions_ui.h" | 5 #include "chrome/browser/extensions/extensions_ui.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/thread.h" | 10 #include "base/thread.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 ExtensionsUIHTMLSource::ExtensionsUIHTMLSource() | 46 ExtensionsUIHTMLSource::ExtensionsUIHTMLSource() |
47 : DataSource(chrome::kChromeUIExtensionsHost, MessageLoop::current()) { | 47 : DataSource(chrome::kChromeUIExtensionsHost, MessageLoop::current()) { |
48 } | 48 } |
49 | 49 |
50 void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, | 50 void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, |
51 int request_id) { | 51 int request_id) { |
52 DictionaryValue localized_strings; | 52 DictionaryValue localized_strings; |
53 localized_strings.SetString(L"title", | 53 localized_strings.SetString(L"title", |
54 l10n_util::GetString(IDS_EXTENSIONS_TITLE)); | 54 l10n_util::GetString(IDS_EXTENSIONS_TITLE)); |
| 55 localized_strings.SetString(L"devToolsLink", |
| 56 l10n_util::GetString(IDS_EXTENSIONS_DEVELOPER_TOOLS_LINK)); |
| 57 localized_strings.SetString(L"devToolsPrefix", |
| 58 l10n_util::GetString(IDS_EXTENSIONS_DEVELOPER_TOOLS_PREFIX)); |
| 59 localized_strings.SetString(L"loadUnpackedButton", |
| 60 l10n_util::GetString(IDS_EXTENSIONS_LOAD_UNPACKED_BUTTON)); |
| 61 localized_strings.SetString(L"packButton", |
| 62 l10n_util::GetString(IDS_EXTENSIONS_PACK_BUTTON)); |
| 63 localized_strings.SetString(L"updateButton", |
| 64 l10n_util::GetString(IDS_EXTENSIONS_UPDATE_BUTTON)); |
| 65 localized_strings.SetString(L"noExtensions", |
| 66 l10n_util::GetString(IDS_EXTENSIONS_NONE_INSTALLED)); |
| 67 localized_strings.SetString(L"extensionDisabled", |
| 68 l10n_util::GetString(IDS_EXTENSIONS_DISABLED_EXTENSION)); |
| 69 localized_strings.SetString(L"extensionId", |
| 70 l10n_util::GetString(IDS_EXTENSIONS_ID)); |
| 71 localized_strings.SetString(L"extensionVersion", |
| 72 l10n_util::GetString(IDS_EXTENSIONS_VERSION)); |
| 73 localized_strings.SetString(L"inspectViews", |
| 74 l10n_util::GetString(IDS_EXTENSIONS_INSPECT_VIEWS)); |
| 75 localized_strings.SetString(L"disable", |
| 76 l10n_util::GetString(IDS_EXTENSIONS_DISABLE)); |
| 77 localized_strings.SetString(L"enable", |
| 78 l10n_util::GetString(IDS_EXTENSIONS_ENABLE)); |
| 79 localized_strings.SetString(L"reload", |
| 80 l10n_util::GetString(IDS_EXTENSIONS_RELOAD)); |
| 81 localized_strings.SetString(L"uninstall", |
| 82 l10n_util::GetString(IDS_EXTENSIONS_UNINSTALL)); |
| 83 localized_strings.SetString(L"options", |
| 84 l10n_util::GetString(IDS_EXTENSIONS_OPTIONS)); |
| 85 localized_strings.SetString(L"packDialogTitle", |
| 86 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_TITLE)); |
55 localized_strings.SetString(L"packDialogHeading", | 87 localized_strings.SetString(L"packDialogHeading", |
56 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_HEADING)); | 88 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_HEADING)); |
57 localized_strings.SetString(L"rootDirectoryLabel", | 89 localized_strings.SetString(L"rootDirectoryLabel", |
58 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_ROOT_DIRECTORY_LABEL)); | 90 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_ROOT_DIRECTORY_LABEL)); |
59 localized_strings.SetString(L"packDialogBrowse", | 91 localized_strings.SetString(L"packDialogBrowse", |
60 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_BROWSE)); | 92 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_BROWSE)); |
61 localized_strings.SetString(L"privateKeyLabel", | 93 localized_strings.SetString(L"privateKeyLabel", |
62 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_PRIVATE_KEY_LABEL)); | 94 l10n_util::GetString(IDS_EXTENSION_PACK_DIALOG_PRIVATE_KEY_LABEL)); |
| 95 localized_strings.SetString(L"okButton", |
| 96 l10n_util::GetString(IDS_OK)); |
| 97 localized_strings.SetString(L"cancelButton", |
| 98 l10n_util::GetString(IDS_CANCEL)); |
63 | 99 |
64 static const base::StringPiece extensions_html( | 100 static const base::StringPiece extensions_html( |
65 ResourceBundle::GetSharedInstance().GetRawDataResource( | 101 ResourceBundle::GetSharedInstance().GetRawDataResource( |
66 IDR_EXTENSIONS_UI_HTML)); | 102 IDR_EXTENSIONS_UI_HTML)); |
67 std::string full_html(extensions_html.data(), extensions_html.size()); | 103 std::string full_html(extensions_html.data(), extensions_html.size()); |
68 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); | 104 jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); |
69 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); | 105 jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); |
70 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); | 106 jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); |
71 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); | 107 jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); |
72 | 108 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // static | 563 // static |
528 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { | 564 RefCountedMemory* ExtensionsUI::GetFaviconResourceBytes() { |
529 return ResourceBundle::GetSharedInstance(). | 565 return ResourceBundle::GetSharedInstance(). |
530 LoadImageResourceBytes(IDR_PLUGIN); | 566 LoadImageResourceBytes(IDR_PLUGIN); |
531 } | 567 } |
532 | 568 |
533 // static | 569 // static |
534 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { | 570 void ExtensionsUI::RegisterUserPrefs(PrefService* prefs) { |
535 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); | 571 prefs->RegisterBooleanPref(prefs::kExtensionsUIDeveloperMode, false); |
536 } | 572 } |
OLD | NEW |