sbDeviceFirmwareModule.cpp
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
30 #include <nsCOMPtr.h>
31 #include <nsServiceManagerUtils.h>
32 #include <nsIAppStartupNotifier.h>
33 #include <nsICategoryManager.h>
34 #include <nsIGenericFactory.h>
35 
37 #include "sbDeviceFirmwareUpdate.h"
39 
43 
44 static NS_METHOD
45 sbDeviceFirmwareUpdaterRegisterSelf(nsIComponentManager* aCompMgr,
46  nsIFile* aPath,
47  const char* registryLocation,
48  const char* componentType,
49  const nsModuleComponentInfo* info)
50 {
51  nsresult rv;
52  nsCOMPtr<nsICategoryManager> categoryManager =
53  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
54  NS_ENSURE_SUCCESS(rv, rv);
55 
56  rv = categoryManager->
57  AddCategoryEntry(APPSTARTUP_CATEGORY,
60  PR_TRUE, PR_TRUE, nsnull);
61  return rv;
62 }
63 
64 static NS_METHOD
65 sbDeviceFirmwareUpdaterUnregisterSelf(nsIComponentManager* aCompMgr,
66  nsIFile* aPath,
67  const char* registryLocation,
68  const nsModuleComponentInfo* info)
69 {
70  nsresult rv;
71  nsCOMPtr<nsICategoryManager> categoryManager =
72  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
73  NS_ENSURE_SUCCESS(rv, rv);
74 
75  rv = categoryManager->DeleteCategoryEntry(APPSTARTUP_CATEGORY,
77  PR_TRUE);
78 
79  return rv;
80 }
81 
82 static nsModuleComponentInfo sbDeviceFirmwareUpdaterComponents[] =
83 {
84  {
88  sbDeviceFirmwareSupportConstructor
89  },
90 
91  {
95  sbDeviceFirmwareUpdateConstructor
96  },
97 
98  {
102  sbDeviceFirmwareUpdaterConstructor,
105  }
106 };
107 
108 NS_IMPL_NSGETMODULE(SongbirdDeviceFirmwareUpdater, sbDeviceFirmwareUpdaterComponents)
NS_GENERIC_FACTORY_CONSTRUCTOR(sbDeviceFirmwareSupport)
_updateCookies aPath
#define SB_DEVICEFIRMWAREUPDATER_DESCRIPTION
#define SB_DEVICEFIRMWAREUPDATER_CLASSNAME
#define SB_DEVICEFIRMWAREUPDATE_CONTRACTID
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(sbDeviceFirmwareUpdater, Init)
#define SB_DEVICEFIRMWAREUPDATE_CID
#define SB_DEVICEFIRMWARESUPPORT_CLASSNAME
static nsModuleComponentInfo sbDeviceFirmwareUpdaterComponents[]
function Init()
static NS_METHOD sbDeviceFirmwareUpdaterUnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const nsModuleComponentInfo *info)
static NS_METHOD sbDeviceFirmwareUpdaterRegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info)
#define SB_DEVICEFIRMWAREUPDATER_CID
#define SB_DEVICEFIRMWARESUPPORT_CONTRACTID
NS_IMPL_NSGETMODULE(SongbirdIdentityServiceComponent, sbIdentityServiceComponent)
#define SB_DEVICEFIRMWAREUPDATE_CLASSNAME
#define SB_DEVICEFIRMWAREUPDATER_CONTRACTID
#define SB_DEVICEFIRMWARESUPPORT_CID