summaryrefslogtreecommitdiffstats
path: root/chrome_frame/np_browser_functions.h
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-10 01:14:41 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-10 01:14:41 +0000
commitf30e74751217091c0b6050080f46cd6eb4914226 (patch)
treea2dcb8e715d1578698856e38c36459602dc19732 /chrome_frame/np_browser_functions.h
parent9b2ab5910c58603ec655bb613bec7596e732f87b (diff)
downloadchromium_src-f30e74751217091c0b6050080f46cd6eb4914226.zip
chromium_src-f30e74751217091c0b6050080f46cd6eb4914226.tar.gz
chromium_src-f30e74751217091c0b6050080f46cd6eb4914226.tar.bz2
Adding a privileged callback used in IE CF to check whether to show
the version mismatch warning dialog. Used this in ceee/ to only show it once per tab. Changed the logic in Firefox to show the warning dialog even when in privileged mode. This will mean it gets shown once per Firefox window. Wrote a unit test for the additional logic in ChromeFrameActivex. To write the unit test, used com_mock.py to generate a mock of the IChromeFramePrivileged interface. This can be extended to generate mocks of the other CF interfaces. Discovered duplication of np_browser_functions.h and .cc, resolved this to a single copy (the one under chrome_frame). Changed things around so chrome_tab.idl is built only once; this also lets me more easily depend on it in the com_mock rule. BUG=none TEST=chrome_frame_unittests.exe Review URL: http://codereview.chromium.org/4563001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/np_browser_functions.h')
-rw-r--r--chrome_frame/np_browser_functions.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome_frame/np_browser_functions.h b/chrome_frame/np_browser_functions.h
index 1a85cee..b2dbd74 100644
--- a/chrome_frame/np_browser_functions.h
+++ b/chrome_frame/np_browser_functions.h
@@ -233,6 +233,38 @@ class ScopedNpObject {
return npo_;
}
+ bool Invoke0(NPP npp, NPIdentifier id, NPVariant* result) {
+ return npapi::Invoke(npp, npo_, id, NULL, 0, result);
+ }
+ bool Invoke0(NPP npp, const NPUTF8* name, NPVariant* result) {
+ return Invoke0(npp, npapi::GetStringIdentifier(name), result);
+ }
+
+ bool Invoke1(NPP npp, NPIdentifier id, const NPVariant &arg1,
+ NPVariant* result) {
+ return npapi::Invoke(npp, npo_, id, &arg1, 1, result);
+ }
+ bool Invoke1(NPP npp, const NPUTF8* name, const NPVariant &arg1,
+ NPVariant* result) {
+ return Invoke1(npp, npapi::GetStringIdentifier(name), arg1, result);
+ }
+ bool InvokeN(NPP npp, NPIdentifier id, const NPVariant* args, unsigned argc,
+ NPVariant* result) {
+ return npapi::Invoke(npp, npo_, id, args, argc, result);
+ }
+ bool InvokeN(NPP npp, const NPUTF8* name, const NPVariant* args,
+ unsigned argc, NPVariant* result) {
+ return Invoke1(npp, npapi::GetStringIdentifier(name), args, argc, result);
+ }
+
+ bool GetProperty(NPP npp, NPIdentifier id, NPVariant* result) {
+ return npapi::GetProperty(npp, npo_, id, result);
+ }
+
+ bool GetProperty(NPP npp, const NPUTF8* name, NPVariant* result) {
+ return GetProperty(npp, npapi::GetStringIdentifier(name), result);
+ }
+
private:
NpoType* npo_;
DISALLOW_COPY_AND_ASSIGN(ScopedNpObject);