OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/plugins_ui.h" | 5 #include "chrome/browser/ui/webui/plugins_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "content/public/browser/web_ui.h" | 37 #include "content/public/browser/web_ui.h" |
38 #include "content/public/browser/web_ui_message_handler.h" | 38 #include "content/public/browser/web_ui_message_handler.h" |
39 #include "grit/browser_resources.h" | 39 #include "grit/browser_resources.h" |
40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
41 #include "grit/theme_resources.h" | 41 #include "grit/theme_resources.h" |
42 #include "grit/theme_resources_standard.h" | 42 #include "grit/theme_resources_standard.h" |
43 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
44 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
45 #include "webkit/plugins/npapi/plugin_group.h" | 45 #include "webkit/plugins/npapi/plugin_group.h" |
46 | 46 |
| 47 #if defined(OS_CHROMEOS) |
| 48 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 49 #endif |
| 50 |
47 #if defined(ENABLE_PLUGIN_INSTALLATION) | 51 #if defined(ENABLE_PLUGIN_INSTALLATION) |
48 #include "chrome/browser/plugin_finder.h" | 52 #include "chrome/browser/plugin_finder.h" |
49 #include "chrome/browser/plugin_installer.h" | 53 #include "chrome/browser/plugin_installer.h" |
50 #else | 54 #else |
51 // Forward-declare PluginFinder. It's never actually used, but we pass a NULL | 55 // Forward-declare PluginFinder. It's never actually used, but we pass a NULL |
52 // pointer instead. | 56 // pointer instead. |
53 class PluginFinder; | 57 class PluginFinder; |
54 #endif | 58 #endif |
55 | 59 |
56 using content::PluginService; | 60 using content::PluginService; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 source->AddLocalizedString("pluginMimeTypesFileExtensions", | 93 source->AddLocalizedString("pluginMimeTypesFileExtensions", |
90 IDS_PLUGINS_MIME_TYPES_FILE_EXTENSIONS); | 94 IDS_PLUGINS_MIME_TYPES_FILE_EXTENSIONS); |
91 source->AddLocalizedString("disable", IDS_PLUGINS_DISABLE); | 95 source->AddLocalizedString("disable", IDS_PLUGINS_DISABLE); |
92 source->AddLocalizedString("enable", IDS_PLUGINS_ENABLE); | 96 source->AddLocalizedString("enable", IDS_PLUGINS_ENABLE); |
93 source->AddLocalizedString("alwaysAllowed", IDS_PLUGINS_ALWAYS_ALLOWED); | 97 source->AddLocalizedString("alwaysAllowed", IDS_PLUGINS_ALWAYS_ALLOWED); |
94 source->AddLocalizedString("noPlugins", IDS_PLUGINS_NO_PLUGINS); | 98 source->AddLocalizedString("noPlugins", IDS_PLUGINS_NO_PLUGINS); |
95 | 99 |
96 source->set_json_path("strings.js"); | 100 source->set_json_path("strings.js"); |
97 source->add_resource_path("plugins.js", IDR_PLUGINS_JS); | 101 source->add_resource_path("plugins.js", IDR_PLUGINS_JS); |
98 source->set_default_resource(IDR_PLUGINS_HTML); | 102 source->set_default_resource(IDR_PLUGINS_HTML); |
| 103 #if defined(OS_CHROMEOS) |
| 104 chromeos::AddAccountUITweaksLocalizedValues(source); |
| 105 #endif |
99 return source; | 106 return source; |
100 } | 107 } |
101 | 108 |
102 string16 PluginTypeToString(int type) { | 109 string16 PluginTypeToString(int type) { |
103 // The type is stored as an |int|, but doing the switch on the right | 110 // The type is stored as an |int|, but doing the switch on the right |
104 // enumeration type gives us better build-time error checking (if someone adds | 111 // enumeration type gives us better build-time error checking (if someone adds |
105 // a new type). | 112 // a new type). |
106 switch (static_cast<WebPluginInfo::PluginType>(type)) { | 113 switch (static_cast<WebPluginInfo::PluginType>(type)) { |
107 case WebPluginInfo::PLUGIN_TYPE_NPAPI: | 114 case WebPluginInfo::PLUGIN_TYPE_NPAPI: |
108 return l10n_util::GetStringUTF16(IDS_PLUGINS_NPAPI); | 115 return l10n_util::GetStringUTF16(IDS_PLUGINS_NPAPI); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 498 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
492 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, | 499 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, |
493 false, | 500 false, |
494 PrefService::UNSYNCABLE_PREF); | 501 PrefService::UNSYNCABLE_PREF); |
495 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, | 502 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, |
496 true, | 503 true, |
497 PrefService::UNSYNCABLE_PREF); | 504 PrefService::UNSYNCABLE_PREF); |
498 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, | 505 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, |
499 PrefService::SYNCABLE_PREF); | 506 PrefService::SYNCABLE_PREF); |
500 } | 507 } |
OLD | NEW |