diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:02:44 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:02:44 +0000 |
commit | e317c9a117b6f365cd6e596dc7e4d1d1365f53a0 (patch) | |
tree | 55e6a2dfe29972c3996d31a14dbba24a061f55fd /chrome | |
parent | 7ae80749da2e8caa8155984be0970ac20a42a04a (diff) | |
download | chromium_src-e317c9a117b6f365cd6e596dc7e4d1d1365f53a0.zip chromium_src-e317c9a117b6f365cd6e596dc7e4d1d1365f53a0.tar.gz chromium_src-e317c9a117b6f365cd6e596dc7e4d1d1365f53a0.tar.bz2 |
Temporary stuff for internal plugins, part 1.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1320002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42674 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_init.cc | 17 | ||||
-rw-r--r-- | chrome/browser/plugin_service.cc | 10 | ||||
-rw-r--r-- | chrome/common/chrome_plugin_lib.cc | 5 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 9 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 3 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 3 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 5 | ||||
-rw-r--r-- | chrome/common/url_constants.h | 4 |
9 files changed, 52 insertions, 5 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 4d45cdd..b4518d7 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -489,6 +489,23 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile, std::vector<GURL> urls_to_open = GetURLsFromCommandLine(profile_); RecordLaunchModeHistogram(urls_to_open.empty()? LM_TO_BE_DECIDED : LM_WITH_URLS); + + // TODO(viettrungluu): Temporary: Display a EULA before allowing the user to + // actually enable Flash, unless they've already accepted it. Process this + // in the same way as command-line URLs. + FilePath flash_path; + if (command_line_.HasSwitch(switches::kEnableInternalFlash) && + PathService::Get(chrome::FILE_FLASH_PLUGIN, &flash_path)) { + PrefService* prefs = profile->GetPrefs(); + // Check whether the EULA has previously been accepted, defaulting to + // "no". If it hasn't, display a page which links to the EULA, etc. (This + // pref is registered by the plugin service.) + if (!prefs->GetBoolean(prefs::kPluginsFlashAuthorized)) { + urls_to_open.push_back( + GURL(chrome::kChromeUIPluginsAuthorizeFlashPathURL)); + } + } + if (!process_startup || !OpenStartupURLs(urls_to_open)) { // Add the home page and any special first run URLs. Browser* browser = NULL; diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 12a15e1..f04d4f3 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -75,6 +75,16 @@ void PluginService::InitGlobalInstance(Profile* profile) { } } + // TODO(viettrungluu): Temporary: If the user hasn't accepted the EULA, + // disable internal Flash (if it's available). + PrefService* prefs = profile->GetPrefs(); + FilePath flash_path; + if (PathService::Get(chrome::FILE_FLASH_PLUGIN, &flash_path)) { + prefs->RegisterBooleanPref(prefs::kPluginsFlashAuthorized, false); + if (!prefs->GetBoolean(prefs::kPluginsFlashAuthorized)) + NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(flash_path)); + } + // Have Chrome plugins write their data to the profile directory. GetInstance()->SetChromePluginDataDir(profile->GetPath()); } diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index eb6bd3e..ceb4e54 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -117,7 +117,10 @@ void ChromePluginLib::RegisterPluginsWithNPAPI() { NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); // Register the internal Flash, if available. - if (PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) + // TODO(viettrungluu): The command-line switch is temporary. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableInternalFlash) && + PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); } diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 7767231..a21e06d 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -191,9 +191,6 @@ const char kDisableWebSecurity[] = "disable-web-security"; // Disable Web Sockets support. const char kDisableWebSockets[] = "disable-web-sockets"; -// Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS. -const char kEnableXSSAuditor[] = "enable-xss-auditor"; - // Use a specific disk cache location, rather than one derived from the // UserDatadir. const char kDiskCacheDir[] = "disk-cache-dir"; @@ -249,6 +246,9 @@ const char kEnableGeolocation[] = "enable-geolocation"; // Enable the Indexed Database API. const char kEnableIndexedDatabase[] = "enable-indexed-database"; +// Enable the internal Flash Player (if available). +const char kEnableInternalFlash[] = "enable-internal-flash"; + // Enable IPv6 support, even if probes suggest that it may not be fully // supported. Some probes may require internet connections, and this flag will // allow support independent of application testing. @@ -322,6 +322,9 @@ const char kEnableVideoLayering[] = "enable-video-layering"; // Order of the listed sub-arguments does not matter. const char kEnableWatchdog[] = "enable-watchdog"; +// Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS. +const char kEnableXSSAuditor[] = "enable-xss-auditor"; + // Enables experimental features for Spellchecker. Right now, the first // experimental feature is auto spell correct, which corrects words which are // misppelled by typing the word with two consecutive letters swapped. The diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index f1997b9..e6d9180 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -70,7 +70,6 @@ extern const char kDisableTabbedBookmarkManager[]; extern const char kDisableWebResources[]; extern const char kDisableWebSecurity[]; extern const char kDisableWebSockets[]; -extern const char kEnableXSSAuditor[]; extern const char kDiskCacheDir[]; extern const char kDiskCacheSize[]; extern const char kDnsLogDetails[]; @@ -89,6 +88,7 @@ extern const char kEnableGeolocation[]; extern const char kEnableGPUPlugin[]; extern const char kEnableGPURendering[]; extern const char kEnableIndexedDatabase[]; +extern const char kEnableInternalFlash[]; extern const char kEnableIPv6[]; extern const char kEnableLogging[]; extern const char kEnableMonitorProfile[]; @@ -107,6 +107,7 @@ extern const char kEnableUserStyleSheet[]; extern const char kEnableVerticalTabs[]; extern const char kEnableVideoLayering[]; extern const char kEnableWatchdog[]; +extern const char kEnableXSSAuditor[]; extern const char kExperimentalSpellcheckerFeatures[]; extern const char kExplicitlyAllowedPorts[]; extern const char kExtensionProcess[]; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 5e4f84d..d43a5db 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -271,6 +271,9 @@ const wchar_t kExtensionsUIDeveloperMode[] = L"extensions.ui.developer_mode"; // actions toolbar. const wchar_t kExtensionToolbarSize[] = L"extensions.toolbarsize"; +// Boolean pref which determines whether the Flash EULA has been accepted. +const wchar_t kPluginsFlashAuthorized[] = L"plugins.flash_authorized"; + // List pref containing information (dictionaries) on plugins. const wchar_t kPluginsPluginsList[] = L"plugins.plugins_list"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index eecb1c1..61c9c44 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 kPluginsFlashAuthorized[]; extern const wchar_t kPluginsPluginsList[]; extern const wchar_t kCheckDefaultBrowser[]; #if defined(OS_MACOSX) diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index eb6fc0d..7ccbcce 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -80,6 +80,11 @@ const char kChromeUINewTabHost[] = "newtab"; const char kChromeUIThumbnailPath[] = "thumb"; const char kChromeUIThemePath[] = "theme"; +// TODO(viettrungluu): Temporary, while we need to display a EULA for Flash. +const char kChromeUIPluginsAuthorizeFlashPathURL[] = + "chrome://plugins/AuthorizeFlash"; +const char kChromeUIPluginsAuthorizeFlashPath[] = "AuthorizeFlash"; + const char kSyncResourcesHost[] = "syncresources"; const char kSyncGaiaLoginPath[] = "gaialogin"; const char kSyncMergeAndSyncPath[] = "mergeandsync"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index 55c49a4..dcf8aca 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -77,6 +77,10 @@ extern const char kChromeUINewTabHost[]; extern const char kChromeUIThumbnailPath[]; extern const char kChromeUIThemePath[]; +// TODO(viettrungluu): Temporary, while we need to display a EULA for Flash. +extern const char kChromeUIPluginsAuthorizeFlashPathURL[]; +extern const char kChromeUIPluginsAuthorizeFlashPath[]; + // Sync related URL components. extern const char kSyncResourcesHost[]; extern const char kSyncGaiaLoginPath[]; |