dom/telephony/TelephonyFactory.cpp
author Gaia Pushbot <release+gaiajson@mozilla.com>
Mon, 14 Oct 2013 09:55:26 -0700
changeset 164500 37e925e977cd1fec6a5b731c4e30b8a260877844
parent 158769 d6920653de69f76ef3cdda22835a42d65b903e18
child 165966 b9c1e3b97da2d9ae3c57e521b91c1c5f9c1d6242
permissions -rw-r--r--
Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/4ef060ed5c40 Author: Eitan Isaacson <eitan@monotonous.org> Desc: Merge pull request #12766 from eeejay/bug-925164 Bug 925164 - Remove role and label from slider area. ======== https://hg.mozilla.org/integration/gaia-central/rev/3417ff371169 Author: Eitan Isaacson <eitan@monotonous.org> Desc: Bug 925164 - Remove role and label from slider area.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 "mozilla/dom/telephony/TelephonyFactory.h"
#ifdef MOZ_WIDGET_GONK
#include "nsIGonkTelephonyProvider.h"
#endif
#include "nsServiceManagerUtils.h"
#include "nsXULAppAPI.h"
#include "ipc/TelephonyIPCProvider.h"

USING_TELEPHONY_NAMESPACE

/* static */ already_AddRefed<nsITelephonyProvider>
TelephonyFactory::CreateTelephonyProvider()
{
  nsCOMPtr<nsITelephonyProvider> provider;

  if (XRE_GetProcessType() == GeckoProcessType_Content) {
    provider = new TelephonyIPCProvider();
#ifdef MOZ_WIDGET_GONK
  } else {
    provider = do_CreateInstance(GONK_TELEPHONY_PROVIDER_CONTRACTID);
#endif
  }

  return provider.forget();
}