diff options
author | aa@google.com <aa@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:57:47 +0000 |
---|---|---|
committer | aa@google.com <aa@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:57:47 +0000 |
commit | 1e0f70402b410a9e274e8d23eeab236b43810a00 (patch) | |
tree | 43ebd89055f4666ab3104554551a2177413382db /chrome/common | |
parent | c2dacc9ec41232903ba700c6aef5ef98bfcb8af8 (diff) | |
download | chromium_src-1e0f70402b410a9e274e8d23eeab236b43810a00.zip chromium_src-1e0f70402b410a9e274e8d23eeab236b43810a00.tar.gz chromium_src-1e0f70402b410a9e274e8d23eeab236b43810a00.tar.bz2 |
Adds a bit of Greasemonkey support hidden behind the --enable-greasemonkey flag. Implementation follows the pattern of the visited links system.
Things still to be done:
- stop using a hardcoded script directory
- watch script directory and update shared memory when necessary
- move file io to background thread
- support for @include patterns -- now, all scripts are applied to all pages
Review URL: http://codereview.chromium.org/7254
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_paths.cc | 5 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 5 |
5 files changed, 16 insertions, 0 deletions
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 2e6d0bb..9d6da38 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -129,6 +129,11 @@ bool PathProvider(int key, std::wstring* result) { return false; file_util::AppendToPath(&cur, L"Dictionaries"); break; + case chrome::DIR_USER_SCRIPTS: + // TODO(aa): Figure out where the script directory should live. + cur = L"C:\\SCRIPTS\\"; + exists = true; // don't trigger directory creation code + break; case chrome::FILE_LOCAL_STATE: if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) return false; diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 02b14ae..8128122 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -24,6 +24,7 @@ enum { DIR_LOCALES, // directory where locale resources are stored DIR_APP_DICTIONARIES, // directory where the global dictionaries are DIR_USER_DOCUMENTS, // directory for a user's "My Documents" + DIR_USER_SCRIPTS, // directory where Greasemonkey user scripts are stored FILE_RESOURCE_MODULE, // full path and filename of the module that contains // embedded resources (version, strings, images, etc.) FILE_LOCAL_STATE, // path and filename to the file in which machine/ diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 1cfc40e7..3428318 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -330,6 +330,9 @@ const wchar_t kEnableP13n[] = L"enable-p13n"; // SDCH is currently only supported server-side for searches on google.com. const wchar_t kSdchFilter[] = L"enable-sdch"; +// Enable Greasemonkey script support. +const wchar_t kEnableGreasemonkey[] = L"enable-greasemonkey"; + // Causes the browser to launch directly in incognito mode. const wchar_t kIncognito[] = L"incognito"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 4c76cdc..19b3ae6 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -128,6 +128,8 @@ extern const wchar_t kEnableP13n[]; extern const wchar_t kSdchFilter[]; +extern const wchar_t kEnableGreasemonkey[]; + extern const wchar_t kIncognito[]; extern const wchar_t kUseNewSafeBrowsing[]; diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index b7966ac..1b28898 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -155,6 +155,11 @@ IPC_BEGIN_MESSAGES(View, 1) // handle. This handle is valid in the context of the renderer IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, SharedMemoryHandle) + // Notification that the Greasemonkey scripts have been updated. It has one + // SharedMemoryHandle argument consisting of the pickled script data. This + // handle is valid in the context of the renderer. + IPC_MESSAGE_CONTROL1(ViewMsg_Greasemonkey_NewScripts, SharedMemoryHandle) + // Sent when the user wants to search for a word on the page (find in page). // Request parameters are passed in as a FindInPageMsg_Request struct. IPC_MESSAGE_ROUTED1(ViewMsg_Find, FindInPageRequest) |