diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 15:18:04 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 15:18:04 +0000 |
commit | 7419d4b42d6be9b4b0f93c3fc4a85ca104e24821 (patch) | |
tree | 93896973bafb635a55e3595bb772356b21b405d0 /chrome_frame | |
parent | e608d5644b2b4c76ffad9a7d443f338746256e8b (diff) | |
download | chromium_src-7419d4b42d6be9b4b0f93c3fc4a85ca104e24821.zip chromium_src-7419d4b42d6be9b4b0f93c3fc4a85ca104e24821.tar.gz chromium_src-7419d4b42d6be9b4b0f93c3fc4a85ca104e24821.tar.bz2 |
Remove extension automation support that was used only by CEEE.
BUG=none
TEST=all automated tests pass
Review URL: http://codereview.chromium.org/6756044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
22 files changed, 23 insertions, 818 deletions
diff --git a/chrome_frame/cfproxy.h b/chrome_frame/cfproxy.h index ca3aa84..a567abc 100644 --- a/chrome_frame/cfproxy.h +++ b/chrome_frame/cfproxy.h @@ -78,14 +78,6 @@ class ChromeProxy { public: // General virtual void RemoveBrowsingData(int remove_mask) = 0; // async - virtual void InstallExtension(ChromeProxyDelegate* delegate, - const FilePath& crx_path, - SyncMessageContext* ctx) = 0; - virtual void LoadExtension(ChromeProxyDelegate* delegate, - const FilePath& path, - SyncMessageContext* ctx) = 0; - virtual void GetEnabledExtensions(ChromeProxyDelegate* delegate, - SyncMessageContext* ctx) = 0; virtual void SetProxyConfig(const std::string& json_encoded_settings) = 0; // Tab management. @@ -124,8 +116,6 @@ class ChromeProxy { // Misc. virtual void Tab_OnHostMoved(int tab) = 0; virtual void Tab_RunUnloadHandlers(int tab) = 0; - virtual void Tab_SetEnableExtensionAutomation(int tab, - const std::vector<std::string>& functions_enabled) = 0; virtual void Tab_Navigate(int tab, const GURL& url, const GURL& referrer) = 0; virtual void Tab_OverrideEncoding(int tab, const char* encoding) = 0; @@ -163,12 +153,6 @@ class ChromeProxyDelegate : public IPC::Channel::Listener { HWND tab_window, int tab_handle, int session_id) = 0; virtual void Completed_Navigate(bool success, enum AutomationMsg_NavigationResponseValues res) = 0; - virtual void Completed_InstallExtension(bool success, - AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx) = 0; - virtual void Completed_LoadExpandedExtension(bool success, - AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx) = 0; - virtual void Completed_GetEnabledExtensions(bool success, - const std::vector<FilePath>* extensions) = 0; protected: ~ChromeProxyDelegate() {} diff --git a/chrome_frame/cfproxy_private.h b/chrome_frame/cfproxy_private.h index 3979e0eb..19ade4e 100644 --- a/chrome_frame/cfproxy_private.h +++ b/chrome_frame/cfproxy_private.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -90,8 +90,6 @@ class Interface2IPCMessage : public ChromeProxy { // Misc. virtual void Tab_OnHostMoved(int tab); - virtual void Tab_SetEnableExtensionAutomation(int tab, - const std::vector<std::string>& functions_enabled); protected: ~Interface2IPCMessage() {} private: @@ -145,12 +143,6 @@ class CFProxy : public Interface2IPCMessage, ////////////////////////////////////////////////////////////////////////// // Sync messages. - virtual void InstallExtension(ChromeProxyDelegate* delegate, - const FilePath& crx_path, SyncMessageContext* ctx); - virtual void LoadExtension(ChromeProxyDelegate* delegate, - const FilePath& path, SyncMessageContext* ctx); - virtual void GetEnabledExtensions(ChromeProxyDelegate* delegate, - SyncMessageContext* ctx); virtual void Tab_Find(int tab, const string16& search_string, FindInPageDirection forward, FindInPageCase match_case, bool find_next); virtual void Tab_OverrideEncoding(int tab, const char* encoding); diff --git a/chrome_frame/cfproxy_proxy.cc b/chrome_frame/cfproxy_proxy.cc index 46ac821..bd38337 100644 --- a/chrome_frame/cfproxy_proxy.cc +++ b/chrome_frame/cfproxy_proxy.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -125,28 +125,6 @@ void CFProxy::SendIpcMessageOnIoThread(IPC::Message* m) { ////////////////////////////////////////////////////////////////////////// // Sync messages. -void CFProxy::InstallExtension(ChromeProxyDelegate* delegate, - const FilePath& crx_path, - SyncMessageContext* ctx) { - IPC::SyncMessage* m = new AutomationMsg_InstallExtension(crx_path, NULL); - sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); - SendIpcMessage(m); -} - -void CFProxy::LoadExtension(ChromeProxyDelegate* delegate, - const FilePath& path, SyncMessageContext* ctx) { - IPC::SyncMessage* m = new AutomationMsg_LoadExpandedExtension(path, 0); - sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); - SendIpcMessage(m); -} - -void CFProxy::GetEnabledExtensions(ChromeProxyDelegate* delegate, - SyncMessageContext* ctx) { - IPC::SyncMessage* m = new AutomationMsg_GetEnabledExtensions(NULL); - sync_dispatcher_.QueueSyncMessage(m, delegate, ctx); - SendIpcMessage(m); -} - void CFProxy::Tab_Find(int tab, const string16& search_string, FindInPageDirection forward, FindInPageCase match_case, bool find_next) { diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc index 9f4edc6..7fd61b7 100644 --- a/chrome_frame/cfproxy_support.cc +++ b/chrome_frame/cfproxy_support.cc @@ -26,10 +26,6 @@ void DispatchReplyFail(uint32 type, case AutomationMsg_ConnectExternalTab::ID: delegate->Completed_ConnectToTab(false, NULL, NULL, 0, 0); break; - case AutomationMsg_InstallExtension::ID: - delegate->Completed_InstallExtension(false, - AUTOMATION_MSG_EXTENSION_INSTALL_FAILED, ctx); - break; } } @@ -59,32 +55,6 @@ bool DispatchReplyOk(const IPC::Message* reply_msg, uint32 type, } return true; } - - case AutomationMsg_InstallExtension::ID: { - // Tuple1<AutomationMsg_ExtensionResponseValues> out; - TupleTypes<AutomationMsg_InstallExtension::ReplyParam>::ValueTuple out; - if (ReadParam(reply_msg, &iter, &out)) - delegate->Completed_InstallExtension(true, out.a, ctx); - return true; - } - - case AutomationMsg_LoadExpandedExtension::ID: { - // Tuple1<AutomationMsg_ExtensionResponseValues> out; - TupleTypes<AutomationMsg_LoadExpandedExtension::ReplyParam>::ValueTuple - out; - if (ReadParam(reply_msg, &iter, &out)) - delegate->Completed_LoadExpandedExtension(true, out.a, ctx); - break; - } - - case AutomationMsg_GetEnabledExtensions::ID: { - // Tuple1<std::vector<FilePath> > - TupleTypes<AutomationMsg_GetEnabledExtensions::ReplyParam>::ValueTuple - out; - if (ReadParam(reply_msg, &iter, &out)) - delegate->Completed_GetEnabledExtensions(true, &out.a); - break; - } } // switch return false; @@ -180,12 +150,6 @@ void Interface2IPCMessage::Tab_OnHostMoved(int tab) { sender_->Send(new AutomationMsg_BrowserMove(tab)); } -void Interface2IPCMessage::Tab_SetEnableExtensionAutomation(int tab, - const std::vector<std::string>& functions_enabled) { - sender_->Send(new AutomationMsg_SetEnableExtensionAutomation(tab, - functions_enabled)); -} - void DelegateHolder::AddDelegate(ChromeProxyDelegate* p) { delegate_list_.insert(p); } diff --git a/chrome_frame/cfproxy_test.cc b/chrome_frame/cfproxy_test.cc index 30ce339..6599000 100644 --- a/chrome_frame/cfproxy_test.cc +++ b/chrome_frame/cfproxy_test.cc @@ -41,12 +41,6 @@ struct MockChromeProxyDelegate : public ChromeProxyDelegate { HWND tab_window, int tab_handle, int session_id)); MOCK_METHOD2(Completed_Navigate, void(bool success, enum AutomationMsg_NavigationResponseValues res)); - MOCK_METHOD3(Completed_InstallExtension, void(bool success, - enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx)); - MOCK_METHOD3(Completed_LoadExpandedExtension, void(bool success, - enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx)); - MOCK_METHOD2(Completed_GetEnabledExtensions, void(bool success, - const std::vector<FilePath>* v)); // Network requests from Chrome. MOCK_METHOD2(Network_Start, void(int request_id, @@ -343,28 +337,20 @@ TEST(SyncMsgSender, Deserialize) { const int kTabHandle = 6; const int kSessionId = 8; - // Create some sync messages and their replies. - AutomationMsg_InstallExtension m1(FilePath(L"c:\\awesome.x"), 0); - AutomationMsg_CreateExternalTab m2(ExternalTabSettings(), 0, 0, 0, 0); - scoped_ptr<IPC::Message> r1(CreateReply(&m1, - AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED)); - scoped_ptr<IPC::Message> r2(CreateReply(&m2, (HWND)1, (HWND)2, kTabHandle, - kSessionId)); + // Create a sync message and its reply. + AutomationMsg_CreateExternalTab m(ExternalTabSettings(), 0, 0, 0, 0); + scoped_ptr<IPC::Message> r(CreateReply(&m, (HWND)1, (HWND)2, kTabHandle, + kSessionId)); - queue.QueueSyncMessage(&m1, &d1, NULL); - queue.QueueSyncMessage(&m2, &d1, NULL); + queue.QueueSyncMessage(&m, &d1, NULL); testing::InSequence s; - EXPECT_CALL(d1, Completed_InstallExtension(true, - AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED, NULL)); EXPECT_CALL(d1, Completed_CreateTab(true, (HWND)1, (HWND)2, kTabHandle, kSessionId)); // Execute replies in a worker thread. ipc.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(&queue, - &SyncMsgSender::OnReplyReceived, r1.get())); - ipc.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(&queue, - &SyncMsgSender::OnReplyReceived, r2.get())); + &SyncMsgSender::OnReplyReceived, r.get())); ipc.Stop(); // Expect that tab 6 has been associated with the delegate. diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc index ecdb1e5..f86eba3 100644 --- a/chrome_frame/chrome_frame_activex.cc +++ b/chrome_frame/chrome_frame_activex.cc @@ -309,33 +309,6 @@ void ChromeFrameActivex::OnAutomationServerLaunchFailed( } } -void ChromeFrameActivex::OnExtensionInstalled( - const FilePath& path, - void* user_data, - AutomationMsg_ExtensionResponseValues response) { - base::win::ScopedBstr path_str(path.value().c_str()); - Fire_onextensionready(path_str, response); -} - -void ChromeFrameActivex::OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories) { - SAFEARRAY* sa = ::SafeArrayCreateVector(VT_BSTR, 0, - extension_directories.size()); - sa->fFeatures = sa->fFeatures | FADF_BSTR; - ::SafeArrayLock(sa); - - for (size_t i = 0; i < extension_directories.size(); ++i) { - LONG index = static_cast<LONG>(i); - ::SafeArrayPutElement(sa, &index, reinterpret_cast<void*>( - CComBSTR(extension_directories[i].value().c_str()).Detach())); - } - - Fire_ongetenabledextensionscomplete(sa); - ::SafeArrayUnlock(sa); - ::SafeArrayDestroy(sa); -} - void ChromeFrameActivex::OnChannelError() { Fire_onchannelerror(); } @@ -485,20 +458,6 @@ HRESULT ChromeFrameActivex::IOleObject_SetClientSite( std::wstring profile_name(GetHostProcessName(false)); if (is_privileged()) { - - base::win::ScopedBstr automated_functions_arg; - service_hr = service->GetExtensionApisToAutomate( - automated_functions_arg.Receive()); - if (S_OK == service_hr && automated_functions_arg) { - std::string automated_functions( - WideToASCII(static_cast<BSTR>(automated_functions_arg))); - functions_enabled_.clear(); - // base::SplitString writes one empty entry for blank strings, so we - // need this to allow specifying zero automation of API functions. - if (!automated_functions.empty()) - base::SplitString(automated_functions, ',', &functions_enabled_); - } - base::win::ScopedBstr profile_name_arg; service_hr = service->GetChromeProfileName(profile_name_arg.Receive()); if (S_OK == service_hr && profile_name_arg) diff --git a/chrome_frame/chrome_frame_activex.h b/chrome_frame/chrome_frame_activex.h index bbad3e8..b2d677b 100644 --- a/chrome_frame/chrome_frame_activex.h +++ b/chrome_frame/chrome_frame_activex.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -97,11 +97,6 @@ END_MSG_MAP() virtual void OnLoadFailed(int error_code, const std::string& url); virtual void OnAutomationServerLaunchFailed( AutomationLaunchResult reason, const std::string& server_version); - virtual void OnExtensionInstalled(const FilePath& path, - void* user_data, AutomationMsg_ExtensionResponseValues response); - virtual void OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories); virtual void OnChannelError(); // Separated to static function for unit testing this logic more easily. diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 2b746eb..820d038 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -117,26 +117,6 @@ class ATL_NO_VTABLE ProxyDIChromeFrameEvents arraysize(args)); } - void Fire_onextensionready(BSTR path, long response) { // NOLINT - // Arguments in reverse order to the function declaration, because - // that's what DISPPARAMS requires. - VARIANT args[2] = { { VT_I4, }, { VT_BSTR, } }; - args[0].lVal = response; - args[1].bstrVal = path; - - FireMethodWithParams(CF_EVENT_DISPID_ONEXTENSIONREADY, - args, - arraysize(args)); - } - - void Fire_ongetenabledextensionscomplete(SAFEARRAY* extension_dirs) { - VARIANT args[1] = { { VT_ARRAY | VT_BSTR } }; - args[0].parray = extension_dirs; - - FireMethodWithParams(CF_EVENT_DISPID_ONGETENABLEDEXTENSIONSCOMPLETE, - args, arraysize(args)); - } - void Fire_onchannelerror() { // NOLINT FireMethodWithParams(CF_EVENT_DISPID_ONCHANNELERROR, NULL, 0); } @@ -174,7 +154,6 @@ class ATL_NO_VTABLE ChromeFrameActivexBase : // NOLINT public com_util::IProvideClassInfo2Impl<class_id, DIID_DIChromeFrameEvents>, public com_util::IDispatchImpl<IChromeFrame>, - public IChromeFrameInternal, public IConnectionPointContainerImpl<T>, public ProxyDIChromeFrameEvents<T>, public IPropertyNotifySinkCP<T>, @@ -208,7 +187,6 @@ DECLARE_NOT_AGGREGATABLE(T) BEGIN_COM_MAP(ChromeFrameActivexBase) COM_INTERFACE_ENTRY(IChromeFrame) COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IChromeFrameInternal) COM_INTERFACE_ENTRY(IViewObjectEx) COM_INTERFACE_ENTRY(IViewObject2) COM_INTERFACE_ENTRY(IViewObject) @@ -826,68 +804,18 @@ END_MSG_MAP() } STDMETHOD(installExtension)(BSTR crx_path) { - DCHECK(automation_client_.get()); - - if (NULL == crx_path) { - NOTREACHED(); - return E_INVALIDARG; - } - - if (!is_privileged()) { - DLOG(ERROR) << "Attempt to installExtension in non-privileged mode"; - return E_ACCESSDENIED; - } - - FilePath::StringType crx_path_str(crx_path); - FilePath crx_file_path(crx_path_str); - - automation_client_->InstallExtension(crx_file_path, NULL); - return S_OK; + NOTREACHED(); // Deprecated. + return E_NOTIMPL; } STDMETHOD(loadExtension)(BSTR path) { - DCHECK(automation_client_.get()); - - if (NULL == path) { - NOTREACHED(); - return E_INVALIDARG; - } - - if (!is_privileged()) { - DLOG(ERROR) << "Attempt to loadExtension in non-privileged mode"; - return E_ACCESSDENIED; - } - - FilePath::StringType path_str(path); - FilePath file_path(path_str); - - automation_client_->LoadExpandedExtension(file_path, NULL); - return S_OK; + NOTREACHED(); // Deprecated. + return E_NOTIMPL; } STDMETHOD(getEnabledExtensions)() { - DCHECK(automation_client_.get()); - - if (!is_privileged()) { - DLOG(ERROR) << "Attempt to getEnabledExtensions in non-privileged mode"; - return E_ACCESSDENIED; - } - - automation_client_->GetEnabledExtensions(NULL); - return S_OK; - } - - STDMETHOD(getSessionId)(int* session_id) { - DCHECK(automation_client_.get()); - DCHECK(session_id); - - if (!is_privileged()) { - DLOG(ERROR) << "Attempt to getSessionId in non-privileged mode"; - return E_ACCESSDENIED; - } - - *session_id = automation_client_->GetSessionId(); - return (*session_id) == -1 ? S_FALSE : S_OK; + NOTREACHED(); // Deprecated. + return E_NOTIMPL; } STDMETHOD(registerBhoIfNeeded)() { diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index c3e101b..d3626eb 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -120,15 +120,6 @@ class ChromeFrameAutomationProxyImpl::CFMsgDispatcher case AutomationMsg_NavigateInExternalTab::ID: InvokeCallback<BeginNavigateContext>(msg, context); break; - case AutomationMsg_InstallExtension::ID: - InvokeCallback<InstallExtensionContext>(msg, context); - break; - case AutomationMsg_LoadExpandedExtension::ID: - InvokeCallback<InstallExtensionContext>(msg, context); - break; - case AutomationMsg_GetEnabledExtensions::ID: - InvokeCallback<GetEnabledExtensionsContext>(msg, context); - break; case AutomationMsg_RunUnloadHandlers::ID: InvokeCallback<UnloadContext>(msg, context); break; @@ -849,69 +840,6 @@ void ChromeFrameAutomationClient::FindInPage(const std::wstring& search_string, automation_server_->SendAsAsync(msg, NULL, this); } -void ChromeFrameAutomationClient::InstallExtension( - const FilePath& crx_path, - void* user_data) { - if (automation_server_ == NULL) { - InstallExtensionComplete(crx_path, - user_data, - AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); - return; - } - - InstallExtensionContext* ctx = new InstallExtensionContext( - this, crx_path, user_data); - - IPC::SyncMessage* msg = new AutomationMsg_InstallExtension(crx_path, NULL); - - // The context will delete itself after it is called. - automation_server_->SendAsAsync(msg, ctx, this); -} - -void ChromeFrameAutomationClient::InstallExtensionComplete( - const FilePath& crx_path, - void* user_data, - AutomationMsg_ExtensionResponseValues res) { - DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_); - - if (chrome_frame_delegate_) { - chrome_frame_delegate_->OnExtensionInstalled(crx_path, user_data, res); - } -} - -void ChromeFrameAutomationClient::GetEnabledExtensions(void* user_data) { - if (automation_server_ == NULL) { - GetEnabledExtensionsComplete(user_data, &std::vector<FilePath>()); - return; - } - - GetEnabledExtensionsContext* ctx = new GetEnabledExtensionsContext( - this, user_data); - - IPC::SyncMessage* msg = new AutomationMsg_GetEnabledExtensions( - ctx->extension_directories()); - - // The context will delete itself after it is called. - automation_server_->SendAsAsync(msg, ctx, this); -} - -void ChromeFrameAutomationClient::GetEnabledExtensionsComplete( - void* user_data, - std::vector<FilePath>* extension_directories) { - DCHECK_EQ(base::PlatformThread::CurrentId(), ui_thread_id_); - - if (chrome_frame_delegate_) { - chrome_frame_delegate_->OnGetEnabledExtensionsComplete( - user_data, *extension_directories); - } - - delete extension_directories; -} - -int ChromeFrameAutomationClient::GetSessionId() const { - return session_id_; -} - void ChromeFrameAutomationClient::OnChromeFrameHostMoved() { // Use a local var to avoid the small possibility of getting the tab_ // member be cleared while we try to use it. @@ -923,25 +851,6 @@ void ChromeFrameAutomationClient::OnChromeFrameHostMoved() { tab->OnHostMoved(); } -void ChromeFrameAutomationClient::LoadExpandedExtension( - const FilePath& path, - void* user_data) { - if (automation_server_ == NULL) { - InstallExtensionComplete(path, - user_data, - AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); - return; - } - - InstallExtensionContext* ctx = new InstallExtensionContext( - this, path, user_data); - - IPC::SyncMessage* msg = new AutomationMsg_LoadExpandedExtension(path, NULL); - - // The context will delete itself after it is called. - automation_server_->SendAsAsync(msg, ctx, this); -} - void ChromeFrameAutomationClient::CreateExternalTab() { AutomationLaunchResult launch_result = AUTOMATION_SUCCESS; DCHECK(IsWindow()); @@ -1000,19 +909,6 @@ AutomationLaunchResult ChromeFrameAutomationClient::CreateExternalTabComplete( return launch_result; } -void ChromeFrameAutomationClient::SetEnableExtensionAutomation( - const std::vector<std::string>& functions_enabled) { - if (!is_initialized()) - return; - - // We are doing initialization, so there is no need to reset extension - // automation, only to set it. Also, we want to avoid resetting extension - // automation that some other automation client has set up. Therefore only - // send the message if we are going to enable automation of some functions. - if (!functions_enabled.empty()) - tab_->SetEnableExtensionAutomation(functions_enabled); -} - // Invoked in launch background thread. void ChromeFrameAutomationClient::LaunchComplete( ChromeFrameAutomationProxy* proxy, diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 31b08d1..18494c3 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -343,34 +343,11 @@ class ChromeFrameAutomationClient const std::string& target); bool SetProxySettings(const std::string& json_encoded_proxy_settings); - virtual void SetEnableExtensionAutomation( - const std::vector<std::string>& functions_enabled); - void FindInPage(const std::wstring& search_string, FindInPageDirection forward, FindInPageCase match_case, bool find_next); - virtual void InstallExtension(const FilePath& crx_path, void* user_data); - - virtual void LoadExpandedExtension(const FilePath& path, void* user_data); - - // Starts a request to get the list of enabled extensions' base directories. - // Response comes back as ChromeFrameDelegate::OnEnabledExtensions(). - virtual void GetEnabledExtensions(void* user_data); - - virtual void InstallExtensionComplete( - const FilePath& path, - void* user_data, - AutomationMsg_ExtensionResponseValues res); - - virtual void GetEnabledExtensionsComplete( - void* user_data, - std::vector<FilePath>* extension_directories); - - // Returns the session ID used to identify a Tab in Chrome. - virtual int GetSessionId() const; - virtual void OnChromeFrameHostMoved(); TabProxy* tab() const { return tab_.get(); } diff --git a/chrome_frame/chrome_frame_delegate.h b/chrome_frame/chrome_frame_delegate.h index 0952d27..3af3bd4 100644 --- a/chrome_frame/chrome_frame_delegate.h +++ b/chrome_frame/chrome_frame_delegate.h @@ -44,13 +44,6 @@ class ChromeFrameDelegate { virtual void OnAutomationServerReady() = 0; virtual void OnAutomationServerLaunchFailed( AutomationLaunchResult reason, const std::string& server_version) = 0; - virtual void OnExtensionInstalled( - const FilePath& path, - void* user_data, - AutomationMsg_ExtensionResponseValues response) = 0; - virtual void OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories) = 0; virtual bool OnMessageReceived(const IPC::Message& msg) = 0; virtual void OnChannelError() = 0; @@ -84,13 +77,6 @@ class ChromeFrameDelegateImpl : public ChromeFrameDelegate { virtual void OnAutomationServerReady() {} virtual void OnAutomationServerLaunchFailed( AutomationLaunchResult reason, const std::string& server_version) {} - virtual void OnExtensionInstalled( - const FilePath& path, - void* user_data, - AutomationMsg_ExtensionResponseValues response) {} - virtual void OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories) {} virtual void OnLoadFailed(int error_code, const std::string& url) {} virtual bool OnMessageReceived(const IPC::Message& msg); virtual void OnChannelError() {} diff --git a/chrome_frame/chrome_frame_npapi.cc b/chrome_frame/chrome_frame_npapi.cc index b503e35..1dff49b 100644 --- a/chrome_frame/chrome_frame_npapi.cc +++ b/chrome_frame/chrome_frame_npapi.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -55,25 +55,16 @@ const NPUTF8* ChromeFrameNPAPI::plugin_property_identifier_names_[] = { "onprivatemessage", "usechromenetwork", "onclose", - "sessionid", }; const NPUTF8* ChromeFrameNPAPI::plugin_method_identifier_names_[] = { "postMessage", "postPrivateMessage", - "installExtension", - "loadExtension", - "enableExtensionAutomation", - "getEnabledExtensions" }; ChromeFrameNPAPI::PluginMethod ChromeFrameNPAPI::plugin_methods_[] = { &ChromeFrameNPAPI::postMessage, &ChromeFrameNPAPI::postPrivateMessage, - &ChromeFrameNPAPI::installExtension, - &ChromeFrameNPAPI::loadExtension, - &ChromeFrameNPAPI::enableExtensionAutomation, - &ChromeFrameNPAPI::getEnabledExtensions, }; NPIdentifier @@ -112,10 +103,6 @@ static const char kPluginChromeExtraArguments[] = "chrome_extra_arguments"; // If privileged mode is enabled, the string value of this argument will // be used as the profile name for our chrome.exe instance. static const char kPluginChromeProfileName[] = "chrome_profile_name"; -// If privileged mode is enabled, this argument will be taken as a -// comma-separated list of API function calls to automate. -static const char kPluginChromeFunctionsAutomatedAttribute[] = - "chrome_functions_automated"; // If chrome network stack is to be used static const char kPluginUseChromeNetwork[] = "usechromenetwork"; @@ -215,13 +202,6 @@ bool ChromeFrameNPAPI::Initialize(NPMIMEType mime_type, NPP instance, chrome_extra_arguments_arg = argv[i]; } else if (LowerCaseEqualsASCII(argn[i], kPluginChromeProfileName)) { chrome_profile_name_arg = argv[i]; - } else if (LowerCaseEqualsASCII(argn[i], - kPluginChromeFunctionsAutomatedAttribute)) { - functions_enabled_.clear(); - // base::SplitString writes one empty entry for blank strings, so we need - // this to allow specifying zero automation of API functions. - if (argv[i][0] != '\0') - base::SplitString(argv[i], ',', &functions_enabled_); } else if (LowerCaseEqualsASCII(argn[i], kPluginUseChromeNetwork)) { chrome_network_arg_set = true; chrome_network_arg = atoi(argv[i]) ? true : false; @@ -666,14 +646,6 @@ bool ChromeFrameNPAPI::GetProperty(NPIdentifier name, plugin_property_identifiers_[PLUGIN_PROPERTY_USECHROMENETWORK]) { BOOLEAN_TO_NPVARIANT(automation_client_->use_chrome_network(), *variant); return true; - } else if (name == plugin_property_identifiers_[PLUGIN_PROPERTY_SESSIONID]) { - if (!is_privileged()) { - DLOG(WARNING) << "Attempt to read sessionid property while not " - "privileged"; - } else { - INT32_TO_NPVARIANT(automation_client_->GetSessionId(), *variant); - return true; - } } return false; @@ -1238,184 +1210,6 @@ bool ChromeFrameNPAPI::postPrivateMessage(NPObject* npobject, return true; } -bool ChromeFrameNPAPI::installExtension(NPObject* npobject, - const NPVariant* args, - uint32_t arg_count, - NPVariant* result) { - if (arg_count > 2 || !NPVARIANT_IS_STRING(args[0]) || - (arg_count == 2 && !NPVARIANT_IS_OBJECT(args[1]))) { - NOTREACHED(); - return false; - } - - if (!is_privileged()) { - DLOG(WARNING) << "installExtension invoked in non-privileged mode"; - return false; - } - - if (!automation_client_.get()) { - DLOG(WARNING) << "installExtension invoked with no automaton client"; - NOTREACHED(); - return false; - } - - const NPString& crx_path_str = args[0].value.stringValue; - std::string crx_path_a(crx_path_str.UTF8Characters, crx_path_str.UTF8Length); - FilePath::StringType crx_path_u(UTF8ToWide(crx_path_a)); - FilePath crx_path(crx_path_u); - NPObject* retained_function = npapi::RetainObject(args[1].value.objectValue); - - automation_client_->InstallExtension(crx_path, retained_function); - // The response to this command will be returned in the OnExtensionInstalled - // delegate callback function. - - return true; -} - -void ChromeFrameNPAPI::OnExtensionInstalled( - const FilePath& path, - void* user_data, - AutomationMsg_ExtensionResponseValues res) { - ScopedNpVariant result; - NPVariant param; - INT32_TO_NPVARIANT(res, param); - NPObject* func = reinterpret_cast<NPObject*>(user_data); - - InvokeDefault(func, param, &result); - npapi::ReleaseObject(func); -} - -bool ChromeFrameNPAPI::loadExtension(NPObject* npobject, - const NPVariant* args, - uint32_t arg_count, - NPVariant* result) { - if (arg_count > 2 || !NPVARIANT_IS_STRING(args[0]) || - (arg_count == 2 && !NPVARIANT_IS_OBJECT(args[1]))) { - NOTREACHED(); - return false; - } - - if (!is_privileged()) { - DLOG(WARNING) << "loadExtension invoked in non-privileged mode"; - return false; - } - - if (!automation_client_.get()) { - DLOG(WARNING) << "loadExtension invoked with no automaton client"; - NOTREACHED(); - return false; - } - - const NPString& path_str = args[0].value.stringValue; - std::string path_a(path_str.UTF8Characters, path_str.UTF8Length); - FilePath::StringType path_u(UTF8ToWide(path_a)); - FilePath path(path_u); - NPObject* retained_function = npapi::RetainObject(args[1].value.objectValue); - - automation_client_->LoadExpandedExtension(path, retained_function); - // The response to this command will be returned in the OnExtensionInstalled - // delegate callback function. - - return true; -} - -bool ChromeFrameNPAPI::enableExtensionAutomation(NPObject* npobject, - const NPVariant* args, - uint32_t arg_count, - NPVariant* result) { - if (arg_count > 1 || (arg_count == 1 && !NPVARIANT_IS_STRING(args[0]))) { - NOTREACHED(); - return false; - } - - if (!is_privileged()) { - DLOG(WARNING) << - "enableExtensionAutomation invoked in non-privileged mode"; - return false; - } - - if (!automation_client_.get()) { - DLOG(WARNING) << - "enableExtensionAutomation invoked with no automaton client"; - NOTREACHED(); - return false; - } - - if (!automation_client_->tab()) { - DLOG(WARNING) << "enableExtensionAutomation invoked with no hosted tab"; - NOTREACHED(); - return false; - } - - // Empty by default e.g. if no arguments passed. - std::vector<std::string> functions; - - if (arg_count == 1) { - const NPString& functions_str = args[0].value.stringValue; - std::string functions_a(functions_str.UTF8Characters, - functions_str.UTF8Length); - - // base::SplitString writes one empty entry for blank strings, so we need - // this to allow specifying zero automation of API functions. - if (functions_a[0] != '\0') - base::SplitString(functions_a, ',', &functions); - } - - automation_client_->tab()->SetEnableExtensionAutomation(functions); - // This function returns no result. - - return true; -} - -bool ChromeFrameNPAPI::getEnabledExtensions(NPObject* npobject, - const NPVariant* args, - uint32_t arg_count, - NPVariant* result) { - if (arg_count > 1 || !NPVARIANT_IS_OBJECT(args[0])) { - NOTREACHED(); - return false; - } - - if (!is_privileged()) { - DLOG(WARNING) << "getEnabledExtensions invoked in non-privileged mode"; - return false; - } - - if (!automation_client_.get()) { - DLOG(WARNING) << "getEnabledExtensions invoked with no automaton client"; - NOTREACHED(); - return false; - } - - NPObject* retained_function = npapi::RetainObject(args[0].value.objectValue); - - automation_client_->GetEnabledExtensions(retained_function); - // The response to this command will be returned in the - // OnGetEnabledExtensionsCompleted delegate callback function. - - return true; -} - -void ChromeFrameNPAPI::OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories) { - std::vector<std::wstring> extension_paths; - for (size_t i = 0; i < extension_directories.size(); ++i) { - extension_paths.push_back(extension_directories[i].value()); - } - std::wstring tab_delimited = JoinString(extension_paths, L'\t'); - - std::string res = WideToUTF8(tab_delimited); - - ScopedNpVariant result; - NPVariant param; - STRINGN_TO_NPVARIANT(res.c_str(), res.length(), param); - - NPObject* func = reinterpret_cast<NPObject*>(user_data); - InvokeDefault(func, param, &result); - npapi::ReleaseObject(func); -} - void ChromeFrameNPAPI::FireEvent(const std::string& event_type, const std::string& data) { NPVariant arg; @@ -1520,4 +1314,3 @@ void ChromeFrameNPAPI::URLRedirectNotify(const char* url, int status, url_fetcher_.UrlRedirectNotify(url, status, notify_data); npapi::URLRedirectResponse(instance_, notify_data, false); } - diff --git a/chrome_frame/chrome_frame_npapi.h b/chrome_frame/chrome_frame_npapi.h index ba36b99..73cbf75 100644 --- a/chrome_frame/chrome_frame_npapi.h +++ b/chrome_frame/chrome_frame_npapi.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -47,7 +47,6 @@ class ChromeFrameNPAPI PLUGIN_PROPERTY_ONPRIVATEMESSAGE, PLUGIN_PROPERTY_USECHROMENETWORK, PLUGIN_PROPERTY_ONCLOSE, - PLUGIN_PROPERTY_SESSIONID, PLUGIN_PROPERTY_COUNT // must be last } PluginPropertyId; @@ -147,11 +146,6 @@ END_MSG_MAP() virtual void OnAutomationServerReady(); virtual void OnAutomationServerLaunchFailed( AutomationLaunchResult reason, const std::string& server_version); - virtual void OnExtensionInstalled(const FilePath& path, - void* user_data, AutomationMsg_ExtensionResponseValues response); - virtual void OnGetEnabledExtensionsComplete( - void* user_data, - const std::vector<FilePath>& extension_directories); virtual void OnCloseTab(); private: @@ -198,22 +192,6 @@ END_MSG_MAP() bool postPrivateMessage(NPObject* npobject, const NPVariant* args, uint32_t arg_count, NPVariant* result); - // This method is only available when the control is in privileged mode. - bool installExtension(NPObject* npobject, const NPVariant* args, - uint32_t arg_count, NPVariant* result); - - // This method is only available when the control is in privileged mode. - bool loadExtension(NPObject* npobject, const NPVariant* args, - uint32_t arg_count, NPVariant* result); - - // This method is only available when the control is in privileged mode. - bool enableExtensionAutomation(NPObject* npobject, const NPVariant* args, - uint32_t arg_count, NPVariant* result); - - // This method is only available when the control is in privileged mode. - bool getEnabledExtensions(NPObject* npobject, const NPVariant* args, - uint32_t arg_count, NPVariant* result); - // Pointers to method implementations. static PluginMethod plugin_methods_[]; diff --git a/chrome_frame/chrome_frame_npapi_unittest.cc b/chrome_frame/chrome_frame_npapi_unittest.cc index f209a86..d53f92e 100644 --- a/chrome_frame/chrome_frame_npapi_unittest.cc +++ b/chrome_frame/chrome_frame_npapi_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -79,8 +79,6 @@ class MockAutomationClient: public ChromeFrameAutomationClient { public: MOCK_METHOD2(Initialize, bool(ChromeFrameDelegate*, ChromeFrameLaunchParams*)); - MOCK_METHOD1(SetEnableExtensionAutomation, - void(const std::vector<std::string>&)); // NOLINT }; class MockProxyService: public NpProxyService { @@ -315,10 +313,6 @@ TEST_F(TestNPAPIPrivilegedApi, PrivilegedAllowsArgsAndProfile) { L"", // No specific language override. L"-bar=far"); // Extra arguments expected - // With privileged mode we expect automation to be enabled. - EXPECT_CALL(*mock_automation, SetEnableExtensionAutomation(_)) - .Times(1); - char* argn[] = { "privileged_mode", "chrome_extra_arguments", @@ -406,11 +400,6 @@ class TestNPAPIPrivilegedProperty: public TestNPAPIPrivilegedApi { EXPECT_CALL(mock_funcs, ReleaseObject(kMockNPObject)) .WillRepeatedly(Return()); - // And we should expect SetEnableExtensionAutomation to be called - // for privileged tests. - EXPECT_CALL(*mock_automation, SetEnableExtensionAutomation(_)) - .WillRepeatedly(Return()); - // Initializes identifiers. EXPECT_CALL(mock_funcs, GetStringIdentifiers(_, _, _)) .WillRepeatedly( @@ -571,4 +560,3 @@ TEST_F(TestNPAPIPrivilegedProperty, } // TODO(siggi): test invoking postPrivateMessage. - diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h index 6b5c8ea..b1a52bc 100644 --- a/chrome_frame/chrome_frame_plugin.h +++ b/chrome_frame/chrome_frame_plugin.h @@ -104,10 +104,6 @@ END_MSG_MAP() return document_url_; } virtual void OnAutomationServerReady() { - // Issue the extension automation request if we're privileged to - // allow this control to handle extension requests from Chrome. - if (is_privileged() && IsValid()) - automation_client_->SetEnableExtensionAutomation(functions_enabled_); } virtual bool IsValid() const { @@ -267,12 +263,6 @@ END_MSG_MAP() // and notifying the host browser that we're doing so. // When the flag is not set, we transfer the focus to chrome. bool ignore_setfocus_; - - // List of functions to enable for automation, or a single entry "*" to - // enable all functions for automation. Ignored unless is_privileged_ is - // true. Defaults to the empty list, meaning automation will not be - // turned on. - std::vector<std::string> functions_enabled_; }; #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ diff --git a/chrome_frame/chrome_tab.idl b/chrome_frame/chrome_tab.idl index 3ec0236..4d11ea4 100644 --- a/chrome_frame/chrome_tab.idl +++ b/chrome_frame/chrome_tab.idl @@ -67,15 +67,15 @@ interface IChromeFrame : IDispatch { HRESULT useChromeNetwork([in] VARIANT_BOOL newVal); [id(12), hidden] - // This method is available only when the control is in privileged mode. + // Deprecated. Returns E_NOTIMPL. HRESULT installExtension([in] BSTR crx_path); [id(13), hidden] - // This method is available only when the control is in privileged mode. + // Deprecated. Returns E_NOTIMPL. HRESULT loadExtension([in] BSTR extension_path); [id(14), hidden] - // This method is available only when the control is in privileged mode. + // Deprecated. Returns E_NOTIMPL. HRESULT getEnabledExtensions(); [id(15)] @@ -85,20 +85,7 @@ interface IChromeFrame : IDispatch { [ object, - uuid(851bedec-4b2c-4959-abc0-a53403117257), - local, // This interface should never be marshaled. - hidden, -] -// Internal implementation interface. Not intended as an API. May change -// frequently, don't treat this as frozen. -interface IChromeFrameInternal : IUnknown { - // This method is available only when the control is in privileged mode. - HRESULT getSessionId([out, retval] int* session_id); -}; - -[ - object, - uuid(B1B52A4D-B22E-489f-8CCD-1CF9166FA90E), + uuid(E98FDFD9-312B-444a-A640-8E88F3CC08B8), oleautomation, nonextensible, hidden, @@ -111,10 +98,6 @@ interface IChromeFramePrivileged : IUnknown { HRESULT GetWantsPrivileged([out] boolean *wants_privileged); // The profile name we want to use. HRESULT GetChromeProfileName([out] BSTR *profile_name); - // The comma-separated list of extension API functions you wish to automate. - // Return S_FALSE to leave the default, which is to not automate any - // functions. - HRESULT GetExtensionApisToAutomate([out] BSTR *extension_apis); // Called when an automation version mismatch occurs. Returns S_OK if // a dialog should be showed to the user by this CF instance, S_FALSE if // not. @@ -131,8 +114,6 @@ typedef enum { CF_EVENT_DISPID_ONLOADERROR, CF_EVENT_DISPID_ONMESSAGE, CF_EVENT_DISPID_ONPRIVATEMESSAGE, - CF_EVENT_DISPID_ONEXTENSIONREADY, - CF_EVENT_DISPID_ONGETENABLEDEXTENSIONSCOMPLETE, CF_EVENT_DISPID_ONCHANNELERROR, CF_EVENT_DISPID_ONCLOSE, CF_EVENT_DISPID_ONREADYSTATECHANGED = DISPID_READYSTATECHANGE, @@ -168,17 +149,6 @@ library ChromeTabLib { // This event is only fired when the control is in privileged mode. void onprivatemessage([in] IDispatch* event, [in] BSTR target); - [id(CF_EVENT_DISPID_ONEXTENSIONREADY)] - // This event is only fired when the control is in privileged mode. - // response is one of AutomationMsg_ExtensionResponseValues. - void onextensionready([in] BSTR path, [in] long response); - - [id(CF_EVENT_DISPID_ONGETENABLEDEXTENSIONSCOMPLETE)] - // This event is only fired when the control is in privileged mode. - // extension_paths is an array of BSTRs of the base directories of - // enabled extensions. - void ongetenabledextensionscomplete([in] SAFEARRAY(BSTR) extension_paths); - [id(CF_EVENT_DISPID_ONCHANNELERROR)] // This event is fired when there is an error in communication channel with // Chrome and Automation must be reconnected to continue. diff --git a/chrome_frame/custom_sync_call_context.h b/chrome_frame/custom_sync_call_context.h index 0167fe5..87eb075 100644 --- a/chrome_frame/custom_sync_call_context.h +++ b/chrome_frame/custom_sync_call_context.h @@ -15,72 +15,6 @@ // TODO(ananta) // Move the implementations of these classes to the source file. -// Class that maintains context during the async load/install extension -// operation. When done, InstallExtensionComplete is posted back to the UI -// thread so that the users of ChromeFrameAutomationClient can be notified. -class InstallExtensionContext - : public SyncMessageReplyDispatcher::SyncMessageCallContext { - public: - typedef Tuple1<AutomationMsg_ExtensionResponseValues> output_type; - - InstallExtensionContext(ChromeFrameAutomationClient* client, - const FilePath& crx_path, void* user_data) : client_(client), - crx_path_(crx_path), user_data_(user_data) { - } - - ~InstallExtensionContext() { - } - - void Completed(AutomationMsg_ExtensionResponseValues res) { - client_->PostTask(FROM_HERE, NewRunnableMethod(client_.get(), - &ChromeFrameAutomationClient::InstallExtensionComplete, crx_path_, - user_data_, res)); - } - - private: - scoped_refptr<ChromeFrameAutomationClient> client_; - FilePath crx_path_; - void* user_data_; -}; - -// Class that maintains context during the async retrieval of fetching the -// list of enabled extensions. When done, GetEnabledExtensionsComplete is -// posted back to the UI thread so that the users of -// ChromeFrameAutomationClient can be notified. -class GetEnabledExtensionsContext - : public SyncMessageReplyDispatcher::SyncMessageCallContext { - public: - typedef Tuple1<std::vector<FilePath> > output_type; - - GetEnabledExtensionsContext( - ChromeFrameAutomationClient* client, void* user_data) : client_(client), - user_data_(user_data) { - extension_directories_ = new std::vector<FilePath>(); - } - - ~GetEnabledExtensionsContext() { - // ChromeFrameAutomationClient::GetEnabledExtensionsComplete takes - // ownership of extension_directories_. - } - - std::vector<FilePath>* extension_directories() { - return extension_directories_; - } - - void Completed( - std::vector<FilePath> result) { - (*extension_directories_) = result; - client_->PostTask(FROM_HERE, NewRunnableMethod(client_.get(), - &ChromeFrameAutomationClient::GetEnabledExtensionsComplete, - user_data_, extension_directories_)); - } - - private: - scoped_refptr<ChromeFrameAutomationClient> client_; - std::vector<FilePath>* extension_directories_; - void* user_data_; -}; - // Class that maintains contextual information for the create and connect // external tab operations. class CreateExternalTabContext diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc index 291104e..c9eb204 100644 --- a/chrome_frame/external_tab.cc +++ b/chrome_frame/external_tab.cc @@ -205,25 +205,6 @@ void ExternalTabProxy::ForwardMessageFromExternalHost( proxy_->Tab_PostMessage(tab_, message, origin, target); } -void ExternalTabProxy::SetEnableExtensionAutomation( - const std::vector<std::string>& functions_enabled) { - proxy_->Tab_SetEnableExtensionAutomation(tab_, functions_enabled); -} - -void ExternalTabProxy::InstallExtension(const FilePath& crx_path, - void* user_data) { - proxy_->InstallExtension(this, crx_path, new UserDataHolder(user_data)); -} - -void ExternalTabProxy::LoadExpandedExtension(const FilePath& path, - void* user_data) { - proxy_->LoadExtension(this, path, new UserDataHolder(user_data)); -} - -void ExternalTabProxy::GetEnabledExtensions(void* user_data) { - proxy_->GetEnabledExtensions(this, new UserDataHolder(user_data)); -} - void ExternalTabProxy::ChromeFrameHostMoved() { proxy_->Tab_OnHostMoved(tab_); } @@ -267,23 +248,6 @@ void ExternalTabProxy::Completed_Navigate( CHECK(0); } -void ExternalTabProxy::Completed_InstallExtension( - bool success, enum AutomationMsg_ExtensionResponseValues res, - SyncMessageContext* ctx) { - CHECK(0); -} - -void ExternalTabProxy::Completed_LoadExpandedExtension( - bool success, enum AutomationMsg_ExtensionResponseValues res, - SyncMessageContext* ctx) { - CHECK(0); -} - -void ExternalTabProxy::Completed_GetEnabledExtensions( - bool success, const std::vector<FilePath>* extensions) { - CHECK(0); -} - void ExternalTabProxy::OnNavigationStateChanged( int flags, const NavigationInfo& nav_info) { ui_.PostTask(FROM_HERE, NewRunnableMethod(ui_delegate_, diff --git a/chrome_frame/external_tab.h b/chrome_frame/external_tab.h index 027f17f..36b3e3d 100644 --- a/chrome_frame/external_tab.h +++ b/chrome_frame/external_tab.h @@ -45,8 +45,6 @@ class UIDelegate { virtual void OnNavigationStateChanged( int flags, const NavigationInfo& nav_info) = 0; virtual void OnUpdateTargetUrl(const std::wstring& new_target_url) = 0; - virtual void OnExtensionInstalled(const FilePath& path, void* user_data, - AutomationMsg_ExtensionResponseValues response) = 0; virtual void OnLoad(const GURL& url) = 0; virtual void OnMoveWindow(const gfx::Rect& pos) = 0; @@ -114,12 +112,6 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>, const std::string& origin, const std::string& target); virtual void ChromeFrameHostMoved(); - virtual void SetEnableExtensionAutomation( - const std::vector<std::string>& functions_enabled); - virtual void InstallExtension(const FilePath& crx_path, void* user_data); - virtual void LoadExpandedExtension(const FilePath& path, void* user_data); - virtual void GetEnabledExtensions(void* user_data); - // Attaches an existing external tab to this automation client instance. virtual void ConnectToExternalTab(uint64 external_tab_cookie); virtual void BlockExternalTab(uint64 cookie); @@ -147,12 +139,6 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>, HWND tab_window, int tab_handle, int session_id); virtual void Completed_Navigate(bool success, enum AutomationMsg_NavigationResponseValues res); - virtual void Completed_InstallExtension(bool success, - enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx); - virtual void Completed_LoadExpandedExtension(bool success, - enum AutomationMsg_ExtensionResponseValues res, SyncMessageContext* ctx); - virtual void Completed_GetEnabledExtensions(bool success, - const std::vector<FilePath>* extensions); // Network requests from Chrome. virtual void OnNetwork_Start( diff --git a/chrome_frame/external_tab_test.cc b/chrome_frame/external_tab_test.cc index ee14672..46da607 100644 --- a/chrome_frame/external_tab_test.cc +++ b/chrome_frame/external_tab_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -36,8 +36,6 @@ struct MockUIDelegate : public UIDelegate { MOCK_METHOD2(OnNavigationStateChanged, void(int flags, const NavigationInfo& nav_info)); MOCK_METHOD1(OnUpdateTargetUrl, void(const std::wstring& new_target_url)); - MOCK_METHOD3(OnExtensionInstalled, void(const FilePath& path, void* user_data, - AutomationMsg_ExtensionResponseValues response)); MOCK_METHOD1(OnLoad, void(const GURL& url)); MOCK_METHOD1(OnMoveWindow, void(const gfx::Rect& pos)); MOCK_METHOD3(OnMessageFromChromeFrame, void(const std::string& message, @@ -53,12 +51,6 @@ struct MockUIDelegate : public UIDelegate { struct MockProxy : public ChromeProxy { MOCK_METHOD1(RemoveBrowsingData, void(int remove_mask)); - MOCK_METHOD3(InstallExtension, void(ChromeProxyDelegate* delegate, - const FilePath& crx_path, SyncMessageContext* ctx)); - MOCK_METHOD3(LoadExtension, void(ChromeProxyDelegate* delegate, - const FilePath& path, SyncMessageContext* ctx)); - MOCK_METHOD2(GetEnabledExtensions, void(ChromeProxyDelegate* delegate, - SyncMessageContext* ctx)); MOCK_METHOD1(SetProxyConfig, void(const std::string& json_encoded_settings)); MOCK_METHOD2(CreateTab, void(ChromeProxyDelegate* delegate, @@ -92,8 +84,6 @@ struct MockProxy : public ChromeProxy { // Misc. MOCK_METHOD1(Tab_OnHostMoved, void(int tab)); MOCK_METHOD1(Tab_RunUnloadHandlers, void(int tab)); - MOCK_METHOD2(Tab_SetEnableExtensionAutomation, void(int tab, - const std::vector<std::string>& functions_enabled)); MOCK_METHOD3(Tab_Navigate, void(int tab, const GURL& url, const GURL& referrer)); MOCK_METHOD2(Tab_OverrideEncoding, void(int tab, const char* encoding)); diff --git a/chrome_frame/test/automation_client_mock.h b/chrome_frame/test/automation_client_mock.h index 52a1ce63..6f736a0 100644 --- a/chrome_frame/test/automation_client_mock.h +++ b/chrome_frame/test/automation_client_mock.h @@ -96,7 +96,6 @@ class MockAutomationProxy : public ChromeFrameAutomationProxy { MOCK_METHOD1(ReleaseTabProxy, void(AutomationHandle handle)); MOCK_METHOD0(server_version, std::string(void)); MOCK_METHOD1(SendProxyConfig, void(const std::string&)); - MOCK_METHOD1(SetEnableExtensionAutomation, void(bool enable)); ~MockAutomationProxy() {} }; diff --git a/chrome_frame/test/data/privileged_apis_host.html b/chrome_frame/test/data/privileged_apis_host.html index fde39e1..052b276 100644 --- a/chrome_frame/test/data/privileged_apis_host.html +++ b/chrome_frame/test/data/privileged_apis_host.html @@ -47,40 +47,8 @@ appendStatus('After postPrivateMessage') } - function tryInstallExtension() { - var cf = GetChromeFrame(); - - try { - // Any message received by this listener is a failure. - // This succeeds in FF, but throws an exception in IE. - cf.installExtension('foo'); - onFailure(testName, 1, 'installExtension should throw'); - } catch(e) { - appendStatus('installExtension threw exception') - } - - appendStatus('After installExtension') - } - - function tryLoadExtension() { - var cf = GetChromeFrame(); - - try { - // Any message received by this listener is a failure. - // This succeeds in FF, but throws an exception in IE. - cf.loadExtension('foo'); - onFailure(testName, 1, 'loadExtension should throw'); - } catch(e) { - appendStatus('loadExtension threw exception') - } - - appendStatus('After loadExtension') - } - function OnChromeFrameLoaded(url) { tryPrivateMessage(); - tryInstallExtension(); - tryLoadExtension(); // The frame reflects this twice, first to a bogus target // and again to the default target '*'. We succeed if we |