diff options
author | Mihai Varga <mihai.mv13@gmail.com> | 2014-07-31 11:33:02 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-15 11:23:26 +0100 |
commit | 4998e6a361252529cabcaac37b0f03bbed173544 (patch) | |
tree | 6cd097acb1ed449939c71f07002f475fca8c693f /ucbhelper | |
parent | fc79b871ecfa351c5ac2587d95d8f65bae811621 (diff) |
Authentication fallback request for the OneDrive connection
To fix build, also squashed in:
Author: Mihai Varga <mihai.mv13@gmail.com>
Date: Fri Aug 1 12:50:23 2014 +0300
OneDrive auth fallback dialog interaction continuation
Change-Id: Id37f502217da3fde55ae93a6e1c01409509d657c
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/Library_ucbhelper.mk | 1 | ||||
-rw-r--r-- | ucbhelper/source/provider/authenticationfallback.cxx | 35 | ||||
-rw-r--r-- | ucbhelper/source/provider/interactionrequest.cxx | 56 |
3 files changed, 92 insertions, 0 deletions
diff --git a/ucbhelper/Library_ucbhelper.mk b/ucbhelper/Library_ucbhelper.mk index 8d1d80523c10..6787db13c4a6 100644 --- a/ucbhelper/Library_ucbhelper.mk +++ b/ucbhelper/Library_ucbhelper.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Library_add_exception_objects,ucbhelper,\ ucbhelper/source/client/fileidentifierconverter \ ucbhelper/source/client/interceptedinteraction \ ucbhelper/source/client/proxydecider \ + ucbhelper/source/provider/authenticationfallback \ ucbhelper/source/provider/cancelcommandexecution \ ucbhelper/source/provider/contenthelper \ ucbhelper/source/provider/contentidentifier \ diff --git a/ucbhelper/source/provider/authenticationfallback.cxx b/ucbhelper/source/provider/authenticationfallback.cxx new file mode 100644 index 000000000000..5d8d0e275894 --- /dev/null +++ b/ucbhelper/source/provider/authenticationfallback.cxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <ucbhelper/authenticationfallback.hxx> + +using namespace com::sun::star; +using namespace ucbhelper; + +AuthenticationFallbackRequest::AuthenticationFallbackRequest( + const OUString & rInstructions, + const OUString & rURL ) +{ + + ucb::AuthenticationFallbackRequest aRequest; + aRequest.instructions = rInstructions; + aRequest.url = rURL; + + setRequest( uno::makeAny( aRequest ) ); + m_xAuthFallback = new InteractionAuthFallback( this ); + + uno::Sequence< + uno::Reference< task::XInteractionContinuation > > aContinuations( 2 ); + aContinuations[ 0 ] = new InteractionAbort( this ); + aContinuations[ 1 ] = m_xAuthFallback.get( ); + + setContinuations( aContinuations ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx index 8e3b68ae36c8..c36c2a68ff6f 100644 --- a/ucbhelper/source/provider/interactionrequest.cxx +++ b/ucbhelper/source/provider/interactionrequest.cxx @@ -940,4 +940,60 @@ void SAL_CALL InteractionReplaceExistingData::select() recordSelection(); } +// InteractionAuthFallback Implementation + +// XInterface methods. + +// virtual +void SAL_CALL InteractionAuthFallback::acquire() + throw() +{ + OWeakObject::acquire(); +} + +// virtual +void SAL_CALL InteractionAuthFallback::release() + throw() +{ + OWeakObject::release(); +} + +// virtual +uno::Any SAL_CALL +InteractionAuthFallback::queryInterface( const uno::Type & rType ) + throw ( uno::RuntimeException, std::exception ) +{ + uno::Any aRet = cppu::queryInterface( rType, + static_cast< task::XInteractionContinuation * >( this ), + static_cast< ucb::XInteractionAuthFallback * >( this )); + + return aRet.hasValue() + ? aRet : InteractionContinuation::queryInterface( rType ); +} + +// XInteractionContinuation methods. + +// virtual +void SAL_CALL InteractionAuthFallback::select() + throw( uno::RuntimeException, std::exception ) +{ + recordSelection(); +} + +// XInteractionAuthFallback methods + +// virtual +void SAL_CALL InteractionAuthFallback::setCode( const OUString& code ) + throw ( uno::RuntimeException, std::exception ) +{ + m_aCode = code; +} + +// virtual +OUString SAL_CALL InteractionAuthFallback::getCode( ) + throw ( uno::RuntimeException, std::exception ) +{ + return m_aCode; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |