From a3b93ed6d8adc562687cbe419a1006660926164b Mon Sep 17 00:00:00 2001 From: Mihai Varga Date: Thu, 31 Jul 2014 11:41:20 +0300 Subject: OneDrive authentication fallback request handler To fix build, squashed in: Author: Mihai Varga Date: Sun Dec 14 12:11:29 2014 +0100 Added namespace for vcl::Window Change-Id: I136912073582c29f68b25787b69f7cc117fb4a6a --- uui/source/iahndl-authentication.cxx | 23 +++++++++++++++++++++++ uui/source/iahndl.cxx | 9 +++++++++ uui/source/iahndl.hxx | 6 ++++++ 3 files changed, 38 insertions(+) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 81cd93a936da..fc5ea18bf85c 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ #include #include +#include "authfallbackdlg.hxx" #include "ids.hrc" #include "getcontinuations.hxx" #include "passwordcontainer.hxx" @@ -744,4 +746,25 @@ UUIInteractionHelper::handlePasswordRequest( return false; } +bool +UUIInteractionHelper::handleAuthFallbackRequest( OUString & instructions, + OUString & url, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations ) +{ + vcl::Window * pParent = getParentProperty( ); + AuthFallbackDlg *dlg = new AuthFallbackDlg( pParent, instructions, url ); + int retCode = dlg->Execute( ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionAuthFallback > xAuthFallback; + getContinuations(rContinuations, &xAbort, &xAuthFallback); + + if( retCode == RET_OK && xAuthFallback.is( ) ) + { + xAuthFallback->setCode( dlg->GetCode( ) ); + xAuthFallback->select( ); + } + + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index d3563d04f411..6178d5925f30 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -805,6 +806,14 @@ UUIInteractionHelper::handleRequest_impl( if (!bObtainErrorStringOnly) { + ucb::AuthenticationFallbackRequest anAuthFallbackRequest; + if ( aAnyRequest >>= anAuthFallbackRequest ) + { + handleAuthFallbackRequest( anAuthFallbackRequest.instructions, + anAuthFallbackRequest.url, rRequest->getContinuations() ); + return true; + } + if ( handleAuthenticationRequest( rRequest ) ) return true; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 68e6b638bbe8..c207092a861b 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -285,6 +285,12 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest, const OUString& i_rServiceName ) const; + + bool + handleAuthFallbackRequest( + OUString & instructions, + OUString & url, + Continuations const & rContinuations ); }; class ErrorResource: private Resource -- cgit v1.2.3