diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 08:01:50 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 08:01:50 +0000 |
commit | 4259f9cc708d8f67d7f935d267da9a7ffa852b65 (patch) | |
tree | 48992e2008df8ff57c600b65f71946774ab074e3 /chrome/browser/extensions/test_extension_loader.h | |
parent | 86fd92283a371973f175b34f39ba8dd6ef86d7bc (diff) | |
download | chromium_src-4259f9cc708d8f67d7f935d267da9a7ffa852b65.zip chromium_src-4259f9cc708d8f67d7f935d267da9a7ffa852b65.tar.gz chromium_src-4259f9cc708d8f67d7f935d267da9a7ffa852b65.tar.bz2 |
Implement chromium.self in content scripts, so that developers don't
have to know and copy/paste their extension ID.
This required moving the code that defaults the extension ID earlier
in the load process.
Also fixed some bugs:
* fixed a bug that was causing all user scripts to get executed in
the same context.
* made the greasemonkey api only available in 'standalone' user
scripts.
* re-added the anonymous function wrapper that is supposed to wrap
content scripts.
Also added unit tests for the fixed bugs.
Review URL: http://codereview.chromium.org/60112
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/test_extension_loader.h')
-rwxr-xr-x | chrome/browser/extensions/test_extension_loader.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/extensions/test_extension_loader.h b/chrome/browser/extensions/test_extension_loader.h new file mode 100755 index 0000000..4fb74d9 --- /dev/null +++ b/chrome/browser/extensions/test_extension_loader.h @@ -0,0 +1,35 @@ +// Copyright (c) 2009 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_EXTENSIONS_TEST_EXTENSION_LOADER_H_ +#define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_LOADER_H_ + +#include "chrome/browser/extensions/extension.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" + +class Extension; +class FilePath; +class Profile; + +class TestExtensionLoader : public NotificationObserver { + public: + explicit TestExtensionLoader(Profile* profile); + + Extension* Load(const char* extension_id, const FilePath& path); + + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + private: + Profile* profile_; + Extension* extension_; + NotificationRegistrar registrar_; + std::string loading_extension_id_; + + DISALLOW_COPY_AND_ASSIGN(TestExtensionLoader); +}; + +#endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_LOADER_H_ |