Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/extensions/chrome_manifest_parser.cc

Issue 14694010: Consolidate manifest handler registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/chrome_manifest_parser.h" 5 #include "chrome/browser/extensions/chrome_manifest_parser.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/extensions/extension_web_ui.h" 8 #include "chrome/browser/extensions/extension_web_ui.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
11 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h"
12 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
13 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h"
14 #include "chrome/common/extensions/manifest_handlers/offline_enabled_info.h"
15 #include "chrome/common/extensions/manifest_handlers/requirements_handler.h"
16 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h"
17 #include "chrome/common/extensions/manifest_url_handler.h"
18 #include "content/public/browser/notification_details.h" 11 #include "content/public/browser/notification_details.h"
19 #include "content/public/browser/notification_service.h" 12 #include "content/public/browser/notification_service.h"
20 13
21 namespace extensions { 14 namespace extensions {
22 15
16 // TODO(yoz): rename this class
23 ChromeManifestParser::ChromeManifestParser(Profile* profile) 17 ChromeManifestParser::ChromeManifestParser(Profile* profile)
24 : profile_(profile) { 18 : profile_(profile) {
25 (new AppIsolationHandler)->Register();
26 (new DevToolsPageHandler)->Register();
27 (new KioskEnabledHandler)->Register();
28 (new HomepageURLHandler)->Register();
29 (new IconsHandler)->Register();
30 (new OfflineEnabledHandler)->Register();
31 (new OptionsPageHandler)->Register();
32 (new RequirementsHandler)->Register();
33 (new SharedModuleHandler)->Register();
34 (new UpdateURLHandler)->Register();
35 (new URLOverridesHandler)->Register();
36
37 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 19 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
38 content::Source<Profile>(profile)); 20 content::Source<Profile>(profile));
39 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 21 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
40 content::Source<Profile>(profile)); 22 content::Source<Profile>(profile));
41 } 23 }
42 24
43 ChromeManifestParser::~ChromeManifestParser() { 25 ChromeManifestParser::~ChromeManifestParser() {
44 } 26 }
45 27
46 void ChromeManifestParser::Observe( 28 void ChromeManifestParser::Observe(
(...skipping 17 matching lines...) Expand all
64 static base::LazyInstance<ProfileKeyedAPIFactory<ChromeManifestParser> > 46 static base::LazyInstance<ProfileKeyedAPIFactory<ChromeManifestParser> >
65 g_factory = LAZY_INSTANCE_INITIALIZER; 47 g_factory = LAZY_INSTANCE_INITIALIZER;
66 48
67 // static 49 // static
68 ProfileKeyedAPIFactory<ChromeManifestParser>* 50 ProfileKeyedAPIFactory<ChromeManifestParser>*
69 ChromeManifestParser::GetFactoryInstance() { 51 ChromeManifestParser::GetFactoryInstance() {
70 return &g_factory.Get(); 52 return &g_factory.Get();
71 } 53 }
72 54
73 } // namespace extensions 55 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698