michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/dom/telephony/TelephonyFactory.h" michael@0: #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) michael@0: #include "nsIGonkTelephonyProvider.h" michael@0: #endif michael@0: #include "nsServiceManagerUtils.h" michael@0: #include "nsXULAppAPI.h" michael@0: #include "ipc/TelephonyIPCProvider.h" michael@0: michael@0: USING_TELEPHONY_NAMESPACE michael@0: michael@0: /* static */ already_AddRefed michael@0: TelephonyFactory::CreateTelephonyProvider() michael@0: { michael@0: nsCOMPtr provider; michael@0: michael@0: if (XRE_GetProcessType() == GeckoProcessType_Content) { michael@0: provider = new TelephonyIPCProvider(); michael@0: #if defined(MOZ_WIDGET_GONK) && defined(MOZ_B2G_RIL) michael@0: } else { michael@0: provider = do_CreateInstance(GONK_TELEPHONY_PROVIDER_CONTRACTID); michael@0: #endif michael@0: } michael@0: michael@0: return provider.forget(); michael@0: }