From cec1b8d4524bd0ce53a7b08b4263c788a5b6d72b Mon Sep 17 00:00:00 2001 From: "viettrungluu@chromium.org" Date: Wed, 24 Mar 2010 00:21:34 +0000 Subject: Implement chrome://plugins page that can disable plugins. BUG=736 TEST=Go to chrome://plugins/. Should be able to enable/disable plugins. Enabled/disabled plugins should persist between sessions. Review URL: http://codereview.chromium.org/1085003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42412 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/generated_resources.grd | 41 ++ chrome/browser/browser_main.cc | 6 +- chrome/browser/browser_prefs.cc | 2 + chrome/browser/browser_resources.grd | 1 + chrome/browser/dom_ui/dom_ui_factory.cc | 8 +- chrome/browser/dom_ui/plugins_ui.cc | 276 ++++++++++ chrome/browser/dom_ui/plugins_ui.h | 24 + chrome/browser/plugin_service.cc | 34 +- chrome/browser/plugin_service.h | 7 +- .../renderer_host/resource_message_filter.cc | 2 +- chrome/browser/resources/plugins.html | 558 +++++++++++++++++++++ chrome/chrome_browser.gypi | 2 + chrome/common/pref_names.cc | 29 +- chrome/common/pref_names.h | 1 + chrome/common/url_constants.cc | 4 +- chrome/common/url_constants.h | 4 +- 16 files changed, 976 insertions(+), 23 deletions(-) create mode 100644 chrome/browser/dom_ui/plugins_ui.cc create mode 100644 chrome/browser/dom_ui/plugins_ui.h create mode 100644 chrome/browser/resources/plugins.html (limited to 'chrome') diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 59a7674..201dc9e 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3460,6 +3460,47 @@ Keep your key file in a safe place. You will need it to create new versions of y Allow + + + Plug-ins + + + Details + + + No plug-ins installed. + + + (Disabled) + + + Version: + + + Description: + + + Location: + + + MIME types: + + + MIME type + + + Description + + + File extensions + + + Disable + + + Enable + + Restore diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 48ecfbb..4cc4d91 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -45,6 +45,7 @@ #include "chrome/browser/plugin_service.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/process_singleton.h" +#include "chrome/browser/profile.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/shell_integration.h" @@ -107,7 +108,6 @@ #include "chrome/browser/browser_trial.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" -#include "chrome/browser/profile.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/views/user_data_dir_dialog.h" #include "chrome/common/env_vars.h" @@ -976,8 +976,8 @@ int BrowserMain(const MainFunctionParams& parameters) { browser_process->google_url_tracker(); browser_process->intranet_redirect_detector(); - // Have Chrome plugins write their data to the profile directory. - PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath()); + // Do initialize the plug-in service (and related preferences). + PluginService::InitGlobalInstance(profile); // Prepare for memory caching of SDCH dictionaries. // Perform A/B test to measure global impact of SDCH support. diff --git a/chrome/browser/browser_prefs.cc b/chrome/browser/browser_prefs.cc index 187201a..12d626d 100644 --- a/chrome/browser/browser_prefs.cc +++ b/chrome/browser/browser_prefs.cc @@ -11,6 +11,7 @@ #include "chrome/browser/cookie_modal_dialog.h" #include "chrome/browser/debugger/devtools_manager.h" #include "chrome/browser/dom_ui/new_tab_ui.h" +#include "chrome/browser/dom_ui/plugins_ui.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/extensions/extension_dom_ui.h" #include "chrome/browser/extensions/extension_prefs.h" @@ -97,6 +98,7 @@ void RegisterUserPrefs(PrefService* user_prefs) { ExtensionDOMUI::RegisterUserPrefs(user_prefs); ExtensionsUI::RegisterUserPrefs(user_prefs); NewTabUI::RegisterUserPrefs(user_prefs); + PluginsUI::RegisterUserPrefs(user_prefs); HostContentSettingsMap::RegisterUserPrefs(user_prefs); HostZoomMap::RegisterUserPrefs(user_prefs); DevToolsManager::RegisterUserPrefs(user_prefs); diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 2562a2c..64127cb 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -52,6 +52,7 @@ without changes to the corresponding grd file. fbt1 --> + diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc index c6fb306..01148d0 100644 --- a/chrome/browser/dom_ui/dom_ui_factory.cc +++ b/chrome/browser/dom_ui/dom_ui_factory.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,6 +14,7 @@ #include "chrome/browser/dom_ui/mediaplayer_ui.h" #include "chrome/browser/dom_ui/net_internals_ui.h" #include "chrome/browser/dom_ui/new_tab_ui.h" +#include "chrome/browser/dom_ui/plugins_ui.h" #include "chrome/browser/dom_ui/print_ui.h" #include "chrome/browser/extensions/extension_dom_ui.h" #include "chrome/browser/extensions/extensions_service.h" @@ -99,6 +100,8 @@ static DOMUIFactoryFunction GetDOMUIFactoryFunction(const GURL& url) { return &NewDOMUI; if (url.host() == chrome::kChromeUINetInternalsHost) return &NewDOMUI; + if (url.host() == chrome::kChromeUIPluginsHost) + return &NewDOMUI; #if defined(OS_CHROMEOS) if (url.host() == chrome::kChromeUIFileBrowseHost) @@ -160,5 +163,8 @@ RefCountedMemory* DOMUIFactory::GetFaviconResourceBytes(Profile* profile, if (page_url.host() == chrome::kChromeUIHistoryHost) return HistoryUI::GetFaviconResourceBytes(); + if (page_url.host() == chrome::kChromeUIPluginsHost) + return PluginsUI::GetFaviconResourceBytes(); + return NULL; } diff --git a/chrome/browser/dom_ui/plugins_ui.cc b/chrome/browser/dom_ui/plugins_ui.cc new file mode 100644 index 0000000..948907d --- /dev/null +++ b/chrome/browser/dom_ui/plugins_ui.cc @@ -0,0 +1,276 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/dom_ui/plugins_ui.h" + +#include "app/l10n_util.h" +#include "app/resource_bundle.h" +#include "base/singleton.h" +#include "base/values.h" +#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/dom_ui/chrome_url_data_manager.h" +#include "chrome/browser/pref_service.h" +#include "chrome/browser/profile.h" +#include "chrome/common/jstemplate_builder.h" +#include "chrome/common/pref_names.h" +#include "chrome/common/url_constants.h" +#include "grit/browser_resources.h" +#include "grit/generated_resources.h" +#include "grit/theme_resources.h" +#include "webkit/glue/plugins/plugin_list.h" + +namespace { + +/////////////////////////////////////////////////////////////////////////////// +// +// PluginsHTMLSource +// +/////////////////////////////////////////////////////////////////////////////// + +class PluginsUIHTMLSource : public ChromeURLDataManager::DataSource { + public: + PluginsUIHTMLSource() + : DataSource(chrome::kChromeUIPluginsHost, MessageLoop::current()) {} + + // Called when the network layer has requested a resource underneath + // the path we registered. + virtual void StartDataRequest(const std::string& path, + bool is_off_the_record, + int request_id); + virtual std::string GetMimeType(const std::string&) const { + return "text/html"; + } + + private: + ~PluginsUIHTMLSource() {} + + DISALLOW_COPY_AND_ASSIGN(PluginsUIHTMLSource); +}; + +void PluginsUIHTMLSource::StartDataRequest(const std::string& path, + bool is_off_the_record, int request_id) { + // Strings used in the JsTemplate file. + DictionaryValue localized_strings; + localized_strings.SetString(L"pluginsTitle", + l10n_util::GetString(IDS_PLUGINS_TITLE)); + localized_strings.SetString(L"pluginsDetailsModeLink", + l10n_util::GetString(IDS_PLUGINS_DETAILS_MODE_LINK)); + localized_strings.SetString(L"pluginsNoneInstalled", + l10n_util::GetString(IDS_PLUGINS_NONE_INSTALLED)); + localized_strings.SetString(L"pluginDisabled", + l10n_util::GetString(IDS_PLUGINS_DISABLED_PLUGIN)); + localized_strings.SetString(L"pluginVersion", + l10n_util::GetString(IDS_PLUGINS_VERSION)); + localized_strings.SetString(L"pluginDescription", + l10n_util::GetString(IDS_PLUGINS_DESCRIPTION)); + localized_strings.SetString(L"pluginPath", + l10n_util::GetString(IDS_PLUGINS_PATH)); + localized_strings.SetString(L"pluginMimeTypes", + l10n_util::GetString(IDS_PLUGINS_MIME_TYPES)); + localized_strings.SetString(L"pluginMimeTypesMimeType", + l10n_util::GetString(IDS_PLUGINS_MIME_TYPES_MIME_TYPE)); + localized_strings.SetString(L"pluginMimeTypesDescription", + l10n_util::GetString(IDS_PLUGINS_MIME_TYPES_DESCRIPTION)); + localized_strings.SetString(L"pluginMimeTypesFileExtensions", + l10n_util::GetString(IDS_PLUGINS_MIME_TYPES_FILE_EXTENSIONS)); + localized_strings.SetString(L"disable", + l10n_util::GetString(IDS_PLUGINS_DISABLE)); + localized_strings.SetString(L"enable", + l10n_util::GetString(IDS_PLUGINS_ENABLE)); + + ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); + + static const base::StringPiece plugins_html( + ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_PLUGINS_HTML)); + std::string full_html(plugins_html.data(), plugins_html.size()); + jstemplate_builder::AppendJsonHtml(&localized_strings, &full_html); + jstemplate_builder::AppendI18nTemplateSourceHtml(&full_html); + jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); + jstemplate_builder::AppendJsTemplateSourceHtml(&full_html); + + scoped_refptr html_bytes(new RefCountedBytes); + html_bytes->data.resize(full_html.size()); + std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); + + SendResponse(request_id, html_bytes); +} + +//////////////////////////////////////////////////////////////////////////////// +// +// PluginsDOMHandler +// +//////////////////////////////////////////////////////////////////////////////// + +// The handler for Javascript messages related to the "history" view. +// TODO(viettrungluu): Make plugin list updates notify, and then observe +// changes; maybe replumb plugin list through plugin service? +// +class PluginsDOMHandler : public DOMMessageHandler { + public: + PluginsDOMHandler() {} + virtual ~PluginsDOMHandler() {} + + // DOMMessageHandler implementation. + virtual void RegisterMessages(); + + // Callback for the "requestPluginsData" message. + void HandleRequestPluginsData(const Value* value); + + // Callback for the "enablePlugin" message. + void HandleEnablePluginMessage(const Value* value); + + private: + // Creates a dictionary containing all the information about the given plugin; + // this is put into the list to "return" for the "requestPluginsData" message. + DictionaryValue* CreatePluginDetailValue(const WebPluginInfo& plugin); + + // Creates a dictionary containing the important parts of the information + // about the given plugin; this is put into a list and saved in prefs. + DictionaryValue* CreatePluginSummaryValue(const WebPluginInfo& plugin); + + // Update the user preferences to reflect the current (user-selected) state of + // plugins. + void UpdatePreferences(); + + DISALLOW_COPY_AND_ASSIGN(PluginsDOMHandler); +}; + +void PluginsDOMHandler::RegisterMessages() { + dom_ui_->RegisterMessageCallback("requestPluginsData", + NewCallback(this, &PluginsDOMHandler::HandleRequestPluginsData)); + dom_ui_->RegisterMessageCallback("enablePlugin", + NewCallback(this, &PluginsDOMHandler::HandleEnablePluginMessage)); +} + +void PluginsDOMHandler::HandleRequestPluginsData(const Value* value) { + DictionaryValue* results = new DictionaryValue(); + + // Add plugins to the results structure. + ListValue* plugins_list = new ListValue(); + + std::vector plugins; + NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + + for (std::vector::const_iterator it = plugins.begin(); + it != plugins.end(); + ++it) { + plugins_list->Append(CreatePluginDetailValue(*it)); + } + results->Set(L"plugins", plugins_list); + + dom_ui_->CallJavascriptFunction(L"returnPluginsData", *results); +} + +void PluginsDOMHandler::HandleEnablePluginMessage(const Value* value) { + CHECK(value->IsType(Value::TYPE_LIST)); + const ListValue* list = static_cast(value); + CHECK(list->GetSize() == 2); + FilePath::StringType plugin_path; + std::string enable_str; + CHECK(list->GetString(0, &plugin_path)); + CHECK(list->GetString(1, &enable_str)); + if (enable_str == "true") + NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(plugin_path)); + else + NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(plugin_path)); + + // TODO(viettrungluu): It's morally wrong to do this here (it should be done + // by the plugins service), and we might also want to ensure that the plugins + // list is always written to prefs even when the user hasn't disabled a + // plugin. This will require refactoring the plugin list and service. + // + UpdatePreferences(); +} + +DictionaryValue* PluginsDOMHandler::CreatePluginDetailValue( + const WebPluginInfo& plugin) { + DictionaryValue* plugin_data = new DictionaryValue(); + plugin_data->SetString(L"path", plugin.path.value()); + plugin_data->SetString(L"name", plugin.name); + plugin_data->SetString(L"version", plugin.version); + plugin_data->SetString(L"description", plugin.desc); + plugin_data->SetBoolean(L"enabled", plugin.enabled); + + ListValue* mime_types = new ListValue(); + for (std::vector::const_iterator type_it = + plugin.mime_types.begin(); + type_it != plugin.mime_types.end(); + ++type_it) { + DictionaryValue* mime_type = new DictionaryValue(); + mime_type->SetString(L"mimeType", type_it->mime_type); + mime_type->SetString(L"description", type_it->description); + + ListValue* file_extensions = new ListValue(); + for (std::vector::const_iterator ext_it = + type_it->file_extensions.begin(); + ext_it != type_it->file_extensions.end(); + ++ext_it) { + file_extensions->Append(new StringValue(*ext_it)); + } + mime_type->Set(L"fileExtensions", file_extensions); + + mime_types->Append(mime_type); + } + plugin_data->Set(L"mimeTypes", mime_types); + + return plugin_data; +} + +DictionaryValue* PluginsDOMHandler::CreatePluginSummaryValue( + const WebPluginInfo& plugin) { + DictionaryValue* plugin_data = new DictionaryValue(); + plugin_data->SetString(L"path", plugin.path.value()); + plugin_data->SetString(L"name", plugin.name); + plugin_data->SetString(L"version", plugin.version); + plugin_data->SetBoolean(L"enabled", plugin.enabled); + return plugin_data; +} + +void PluginsDOMHandler::UpdatePreferences() { + ListValue* plugins_list = dom_ui_->GetProfile()->GetPrefs()->GetMutableList( + prefs::kPluginsPluginsList); + plugins_list->Clear(); + + std::vector plugins; + NPAPI::PluginList::Singleton()->GetPlugins(false, &plugins); + + for (std::vector::const_iterator it = plugins.begin(); + it != plugins.end(); + ++it) { + plugins_list->Append(CreatePluginSummaryValue(*it)); + } +} + +} // namespace + +/////////////////////////////////////////////////////////////////////////////// +// +// PluginsUI +// +/////////////////////////////////////////////////////////////////////////////// + +PluginsUI::PluginsUI(TabContents* contents) : DOMUI(contents) { + AddMessageHandler((new PluginsDOMHandler())->Attach(this)); + + PluginsUIHTMLSource* html_source = new PluginsUIHTMLSource(); + + // Set up the chrome://plugins/ source. + ChromeThread::PostTask( + ChromeThread::IO, FROM_HERE, + NewRunnableMethod(Singleton::get(), + &ChromeURLDataManager::AddDataSource, + make_scoped_refptr(html_source))); +} + + +// static +RefCountedMemory* PluginsUI::GetFaviconResourceBytes() { + return ResourceBundle::GetSharedInstance(). + LoadDataResourceBytes(IDR_PLUGIN); +} + +// static +void PluginsUI::RegisterUserPrefs(PrefService* prefs) { + prefs->RegisterListPref(prefs::kPluginsPluginsList); +} diff --git a/chrome/browser/dom_ui/plugins_ui.h b/chrome/browser/dom_ui/plugins_ui.h new file mode 100644 index 0000000..00dbce9 --- /dev/null +++ b/chrome/browser/dom_ui/plugins_ui.h @@ -0,0 +1,24 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_DOM_UI_PLUGINS_UI_H_ +#define CHROME_BROWSER_DOM_UI_PLUGINS_UI_H_ + +#include "chrome/browser/dom_ui/dom_ui.h" + +class PrefService; +class RefCountedMemory; + +class PluginsUI : public DOMUI { + public: + explicit PluginsUI(TabContents* contents); + + static RefCountedMemory* GetFaviconResourceBytes(); + static void RegisterUserPrefs(PrefService* prefs); + + private: + DISALLOW_COPY_AND_ASSIGN(PluginsUI); +}; + +#endif // CHROME_BROWSER_DOM_UI_PLUGINS_UI_H_ diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 987d68e..12a15e1 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,12 +10,15 @@ #include "base/path_service.h" #include "base/string_util.h" #include "base/thread.h" +#include "base/values.h" #include "base/waitable_event.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_plugin_host.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/plugin_process_host.h" +#include "chrome/browser/pref_service.h" +#include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/common/chrome_plugin_lib.h" #include "chrome/common/chrome_paths.h" @@ -25,6 +28,7 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/notification_type.h" #include "chrome/common/notification_service.h" +#include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #ifndef DISABLE_NACL #include "native_client/src/trusted/plugin/nacl_entry_points.h" @@ -48,6 +52,34 @@ static void NotifyPluginsOfActivation() { bool PluginService::enable_chrome_plugins_ = true; // static +void PluginService::InitGlobalInstance(Profile* profile) { + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + + // Disable plugins listed as disabled in prefs. + if (const ListValue* saved_plugins_list = + profile->GetPrefs()->GetList(prefs::kPluginsPluginsList)) { + for (ListValue::const_iterator it = saved_plugins_list->begin(); + it != saved_plugins_list->end(); + ++it) { + if (!(*it)->IsType(Value::TYPE_DICTIONARY)) { + LOG(WARNING) << "Invalid entry in " << prefs::kPluginsPluginsList; + continue; // Oops, don't know what to do with this item. + } + + DictionaryValue* plugin = static_cast(*it); + FilePath::StringType path; + bool enabled = true; + plugin->GetBoolean(L"enabled", &enabled); + if (!enabled && plugin->GetString(L"path", &path)) + NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(path)); + } + } + + // Have Chrome plugins write their data to the profile directory. + GetInstance()->SetChromePluginDataDir(profile->GetPath()); +} + +// static PluginService* PluginService::GetInstance() { return Singleton::get(); } diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h index 7ab39e2..f3214e0 100644 --- a/chrome/browser/plugin_service.h +++ b/chrome/browser/plugin_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,6 +31,7 @@ class Message; class MessageLoop; class PluginProcessHost; +class Profile; class URLRequestContext; class ResourceDispatcherHost; class ResourceMessageFilter; @@ -41,6 +42,10 @@ class PluginService : public base::WaitableEventWatcher::Delegate, public NotificationObserver { public: + // Initializes the global instance; should be called on startup from the main + // thread. + static void InitGlobalInstance(Profile* profile); + // Returns the PluginService singleton. static PluginService* GetInstance(); diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index 74ae523..48c1cb6 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -746,7 +746,7 @@ void ResourceMessageFilter::OnGetPluginsOnFileThread( bool refresh, IPC::Message* reply_msg) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); std::vector plugins; - NPAPI::PluginList::Singleton()->GetPlugins(refresh, &plugins); + NPAPI::PluginList::Singleton()->GetEnabledPlugins(refresh, &plugins); ViewHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins); ChromeThread::PostTask( ChromeThread::IO, FROM_HERE, diff --git a/chrome/browser/resources/plugins.html b/chrome/browser/resources/plugins.html new file mode 100644 index 0000000..19cbedb --- /dev/null +++ b/chrome/browser/resources/plugins.html @@ -0,0 +1,558 @@ + + + + + + + + + + + + diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 935162d..b408402 100755 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -866,6 +866,8 @@ 'browser/dom_ui/new_tab_ui.h', 'browser/dom_ui/ntp_resource_cache.cc', 'browser/dom_ui/ntp_resource_cache.h', + 'browser/dom_ui/plugins_ui.cc', + 'browser/dom_ui/plugins_ui.h', 'browser/dom_ui/print_ui.cc', 'browser/dom_ui/print_ui.h', 'browser/dom_ui/shown_sections_handler.cc', diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 62486e3..5e4f84d 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -163,38 +163,36 @@ const wchar_t kDnsStartupPrefetchList[] = L"StartupDNSPrefetchList"; // sub-resource hostnames (and expected latency benefits from pre-resolving such // sub-resource hostnames). // This list is adaptively grown and pruned. -extern const wchar_t kDnsHostReferralList[] = L"HostReferralList"; +const wchar_t kDnsHostReferralList[] = L"HostReferralList"; // Is the cookie prompt expanded? -extern const wchar_t kCookiePromptExpanded[] = L"cookieprompt.expanded"; +const wchar_t kCookiePromptExpanded[] = L"cookieprompt.expanded"; #if defined(USE_NSS) // Prefs for SSLConfigServicePref. Currently, these are only present on // and used by NSS-using OSes. -extern const wchar_t kCertRevocationCheckingEnabled[] = - L"ssl.rev_checking.enabled"; -extern const wchar_t kSSL2Enabled[] = L"ssl.ssl2.enabled"; -extern const wchar_t kSSL3Enabled[] = L"ssl.ssl3.enabled"; -extern const wchar_t kTLS1Enabled[] = L"ssl.tls1.enabled"; +const wchar_t kCertRevocationCheckingEnabled[] = L"ssl.rev_checking.enabled"; +const wchar_t kSSL2Enabled[] = L"ssl.ssl2.enabled"; +const wchar_t kSSL3Enabled[] = L"ssl.ssl3.enabled"; +const wchar_t kTLS1Enabled[] = L"ssl.tls1.enabled"; #endif #if defined(OS_CHROMEOS) // A string pref set to the timezone. -extern const wchar_t kTimeZone[] = L"settings.datetime.timezone"; +const wchar_t kTimeZone[] = L"settings.datetime.timezone"; // A boolean pref set to true if TapToClick is being done in browser. -extern const wchar_t kTapToClickEnabled[] = - L"settings.touchpad.enable_tap_to_click"; +const wchar_t kTapToClickEnabled[] = L"settings.touchpad.enable_tap_to_click"; // A boolean pref set to true if VertEdgeScroll is being done in browser. -extern const wchar_t kVertEdgeScrollEnabled[] = +const wchar_t kVertEdgeScrollEnabled[] = L"settings.touchpad.enable_vert_edge_scroll"; // A integer pref for the touchpad speed factor. -extern const wchar_t kTouchpadSpeedFactor[] = L"settings.touchpad.speed_factor"; +const wchar_t kTouchpadSpeedFactor[] = L"settings.touchpad.speed_factor"; // A integer pref for the touchpad sensitivity. -extern const wchar_t kTouchpadSensitivity[] = L"settings.touchpad.sensitivity"; +const wchar_t kTouchpadSensitivity[] = L"settings.touchpad.sensitivity"; #endif // The disabled messages in IPC logging. @@ -273,6 +271,9 @@ const wchar_t kExtensionsUIDeveloperMode[] = L"extensions.ui.developer_mode"; // actions toolbar. const wchar_t kExtensionToolbarSize[] = L"extensions.toolbarsize"; +// List pref containing information (dictionaries) on plugins. +const wchar_t kPluginsPluginsList[] = L"plugins.plugins_list"; + // Boolean that indicates whether we should check if we are the default browser // on start-up. const wchar_t kCheckDefaultBrowser[] = L"browser.check_default_browser"; @@ -407,7 +408,7 @@ const wchar_t kStabilityStatsVersion[] = // Build time, in seconds since an epoch, which is used to assure that stability // metrics reported reflect stability of the same build. -extern const wchar_t kStabilityStatsBuildTime[] = +const wchar_t kStabilityStatsBuildTime[] = L"user_experience_metrics.stability.stats_buildtime"; // False if we received a session end and either we crashed during processing diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index a8b2de9..eecb1c1 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -110,6 +110,7 @@ extern const wchar_t kCurrentThemeTints[]; extern const wchar_t kCurrentThemeDisplayProperties[]; extern const wchar_t kExtensionsUIDeveloperMode[]; extern const wchar_t kExtensionToolbarSize[]; +extern const wchar_t kPluginsPluginsList[]; extern const wchar_t kCheckDefaultBrowser[]; #if defined(OS_MACOSX) extern const wchar_t kShowUpdatePromotionInfoBar[]; diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 9d24745..d770685 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -38,11 +38,11 @@ const char* kSavableSchemes[] = { const char kAboutBlankURL[] = "about:blank"; const char kAboutCacheURL[] = "about:cache"; -const char kAboutNetInternalsURL[] = "about:net-internals"; const char kAboutCrashURL[] = "about:crash"; const char kAboutCreditsURL[] = "about:credits"; const char kAboutHangURL[] = "about:hang"; const char kAboutMemoryURL[] = "about:memory"; +const char kAboutNetInternalsURL[] = "about:net-internals"; const char kAboutShorthangURL[] = "about:shorthang"; const char kAboutTermsURL[] = "about:terms"; @@ -55,6 +55,7 @@ const char kChromeUIDevToolsURL[] = "chrome://devtools/"; const char kChromeUIDownloadsURL[] = "chrome://downloads/"; const char kChromeUIExtensionsURL[] = "chrome://extensions/"; const char kChromeUIHistoryURL[] = "chrome://history/"; +const char kChromeUIPluginsURL[] = "chrome://plugins/"; const char kChromeUIFileBrowseURL[] = "chrome://filebrowse/"; const char kChromeUIMediaplayerURL[] = "chrome://mediaplayer/"; const char kChromeUIIPCURL[] = "chrome://about/ipc"; @@ -68,6 +69,7 @@ const char kChromeUIDownloadsHost[] = "downloads"; const char kChromeUIExtensionsHost[] = "extensions"; const char kChromeUIFavIconPath[] = "favicon"; const char kChromeUIHistoryHost[] = "history"; +const char kChromeUIPluginsHost[] = "plugins"; const char kChromeUIFileBrowseHost[] = "filebrowse"; const char kChromeUIMediaplayerHost[] = "mediaplayer"; const char kChromeUIInspectorHost[] = "inspector"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index 665bd66..d4f2ee5 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -32,7 +32,7 @@ extern const char kStandardSchemeSeparator[]; // Null terminated list of schemes that are savable. extern const char* kSavableSchemes[]; -// About URLs (including schmes). +// About URLs (including schemes). extern const char kAboutBlankURL[]; extern const char kAboutBrowserCrash[]; extern const char kAboutCacheURL[]; @@ -51,6 +51,7 @@ extern const char kChromeUIDevToolsURL[]; extern const char kChromeUIDownloadsURL[]; extern const char kChromeUIExtensionsURL[]; extern const char kChromeUIHistoryURL[]; +extern const char kChromeUIPluginsURL[]; extern const char kChromeUIFileBrowseURL[]; extern const char kChromeUIMediaplayerURL[]; extern const char kChromeUIIPCURL[]; @@ -66,6 +67,7 @@ extern const char kChromeUIDownloadsHost[]; extern const char kChromeUIExtensionsHost[]; extern const char kChromeUIFavIconPath[]; extern const char kChromeUIHistoryHost[]; +extern const char kChromeUIPluginsHost[]; extern const char kChromeUIFileBrowseHost[]; extern const char kChromeUIMediaplayerHost[]; extern const char kChromeUIInspectorHost[]; -- cgit v1.1