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

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

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin Created 7 years, 10 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/manifest_url_parser.h" 5 #include "chrome/browser/extensions/manifest_url_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/extension_manifest_constants.h" 11 #include "chrome/common/extensions/extension_manifest_constants.h"
12 #include "chrome/common/extensions/manifest_handler.h" 12 #include "chrome/common/extensions/manifest_handler.h"
13 #include "chrome/common/extensions/manifest_url_handler.h" 13 #include "chrome/common/extensions/manifest_url_handler.h"
14 #include "content/public/browser/notification_details.h" 14 #include "content/public/browser/notification_details.h"
15 #include "content/public/browser/notification_service.h" 15 #include "content/public/browser/notification_service.h"
16 16
17 namespace extensions { 17 namespace extensions {
18 18
19 ManifestURLParser::ManifestURLParser(Profile* profile) 19 ManifestURLParser::ManifestURLParser(Profile* profile)
20 : profile_(profile) { 20 : profile_(profile) {
21 ManifestHandler::Register(extension_manifest_keys::kDevToolsPage, 21 ManifestHandler::Register(extension_manifest_keys::kDevToolsPage,
22 new DevToolsPageHandler); 22 make_linked_ptr(new DevToolsPageHandler));
23 ManifestHandler::Register(extension_manifest_keys::kHomepageURL, 23 ManifestHandler::Register(extension_manifest_keys::kHomepageURL,
24 new HomepageURLHandler); 24 make_linked_ptr(new HomepageURLHandler));
25 ManifestHandler::Register(extension_manifest_keys::kUpdateURL, 25 ManifestHandler::Register(extension_manifest_keys::kUpdateURL,
26 new UpdateURLHandler); 26 make_linked_ptr(new UpdateURLHandler));
27 ManifestHandler::Register(extension_manifest_keys::kOptionsPage, 27 ManifestHandler::Register(extension_manifest_keys::kOptionsPage,
28 new OptionsPageHandler); 28 make_linked_ptr(new OptionsPageHandler));
29 ManifestHandler::Register(extension_manifest_keys::kChromeURLOverrides, 29 ManifestHandler::Register(extension_manifest_keys::kChromeURLOverrides,
30 new URLOverridesHandler); 30 make_linked_ptr(new URLOverridesHandler));
31 31
32 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 32 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
33 content::Source<Profile>(profile)); 33 content::Source<Profile>(profile));
34 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 34 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
35 content::Source<Profile>(profile)); 35 content::Source<Profile>(profile));
36 } 36 }
37 37
38 ManifestURLParser::~ManifestURLParser() { 38 ManifestURLParser::~ManifestURLParser() {
39 } 39 }
40 40
(...skipping 17 matching lines...) Expand all
58 static base::LazyInstance<ProfileKeyedAPIFactory<ManifestURLParser> > 58 static base::LazyInstance<ProfileKeyedAPIFactory<ManifestURLParser> >
59 g_factory = LAZY_INSTANCE_INITIALIZER; 59 g_factory = LAZY_INSTANCE_INITIALIZER;
60 60
61 // static 61 // static
62 ProfileKeyedAPIFactory<ManifestURLParser>* 62 ProfileKeyedAPIFactory<ManifestURLParser>*
63 ManifestURLParser::GetFactoryInstance() { 63 ManifestURLParser::GetFactoryInstance() {
64 return &g_factory.Get(); 64 return &g_factory.Get();
65 } 65 }
66 66
67 } // namespace extensions 67 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698