Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5289)

Unified Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 426014: Merge 32770 - Revert change that disallowed content scripts access to... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_startup_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_ui.cc
===================================================================
--- chrome/browser/extensions/extension_install_ui.cc (revision 32777)
+++ chrome/browser/extensions/extension_install_ui.cc (working copy)
@@ -21,6 +21,7 @@
#endif // TOOLKIT_VIEWS
#include "chrome/common/extensions/extension.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/url_constants.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -39,6 +40,25 @@
if (!extension->plugins().empty())
return l10n_util::GetString(IDS_EXTENSION_PROMPT_WARNING_NEW_FULL_ACCESS);
+ // We also show the severe warning if the extension has access to any file://
+ // URLs. They aren't *quite* as dangerous as full access to the system via
+ // NPAPI, but pretty dang close. Content scripts are currently the only way
+ // that extension can get access to file:// URLs.
+ for (UserScriptList::const_iterator script =
+ extension->content_scripts().begin();
+ script != extension->content_scripts().end();
+ ++script) {
+ for (UserScript::PatternList::const_iterator pattern =
+ script->url_patterns().begin();
+ pattern != script->url_patterns().end();
+ ++pattern) {
+ if (pattern->scheme() == chrome::kFileScheme) {
+ return l10n_util::GetString(
+ IDS_EXTENSION_PROMPT_WARNING_NEW_FULL_ACCESS);
+ }
+ }
+ }
+
// Otherwise, we go in descending order of severity: all hosts, several hosts,
// a single host, no hosts. For each of these, we also have a variation of the
// message for when api permissions are also requested.
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698