diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 03:28:51 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-23 03:28:51 +0000 |
commit | c931db6d8adbf334c86e31714e2897bc2e9db08a (patch) | |
tree | cf83d11e8e00e45a4733ad62c1a38f0925d8dd8c /chrome/browser/extensions/user_script_master.h | |
parent | d146b8311c38186872d2be3764e2c2d66827107f (diff) | |
download | chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.zip chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.tar.gz chromium_src-c931db6d8adbf334c86e31714e2897bc2e9db08a.tar.bz2 |
Don't inject content scripts into incognito browsers.
This patch prevents content scripts from being injected into incognito profile tabs by only injecting into the same profile in which the extension is running.
BUG=21392
TEST=Load chrome/test/data/extensions/api/incognito_no_script and open any url in incognito browser. No page titles should be modified to "modified".
Review URL: http://codereview.chromium.org/502079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/user_script_master.h')
-rw-r--r-- | chrome/browser/extensions/user_script_master.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h index ff1e589..3a7afd5 100644 --- a/chrome/browser/extensions/user_script_master.h +++ b/chrome/browser/extensions/user_script_master.h @@ -12,6 +12,7 @@ #include "base/scoped_ptr.h" #include "base/shared_memory.h" #include "chrome/browser/chrome_thread.h" +#include "chrome/browser/profile.h" #include "chrome/common/extensions/user_script.h" #include "chrome/common/notification_registrar.h" #include "testing/gtest/include/gtest/gtest_prod.h" @@ -28,7 +29,7 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, public: // For testability, the constructor takes the path the scripts live in. // This is normally a directory inside the profile. - explicit UserScriptMaster(const FilePath& script_dir); + explicit UserScriptMaster(const FilePath& script_dir, Profile* profile); // Add a watched directory. All scripts will be reloaded when any file in // this directory changes. @@ -164,6 +165,9 @@ class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, // finishes. This boolean tracks whether another scan is pending. bool pending_scan_; + // The profile for which the scripts managed here are installed. + Profile* profile_; + DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); }; |