OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/api/themes/theme_api.h" | 5 #include "chrome/browser/extensions/api/themes/theme_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/common/extensions/api/themes/theme_handler.h" | 8 #include "chrome/common/extensions/api/themes/theme_handler.h" |
9 #include "chrome/common/extensions/extension_manifest_constants.h" | |
10 #include "chrome/common/extensions/manifest_handler.h" | |
11 | 9 |
12 namespace extensions { | 10 namespace extensions { |
13 | 11 |
14 ThemeAPI::ThemeAPI(Profile* profile) { | 12 ThemeAPI::ThemeAPI(Profile* profile) { |
15 // Register the ManifestHandler for parsing 'theme' manifest key. | 13 (new extensions::ThemeHandler)->Register(); |
16 extensions::ManifestHandler::Register( | |
17 extension_manifest_keys::kTheme, | |
18 make_linked_ptr(new extensions::ThemeHandler)); | |
19 } | 14 } |
20 | 15 |
21 ThemeAPI::~ThemeAPI() { | 16 ThemeAPI::~ThemeAPI() { |
22 } | 17 } |
23 | 18 |
24 static base::LazyInstance<ProfileKeyedAPIFactory<ThemeAPI> > | 19 static base::LazyInstance<ProfileKeyedAPIFactory<ThemeAPI> > |
25 g_factory = LAZY_INSTANCE_INITIALIZER; | 20 g_factory = LAZY_INSTANCE_INITIALIZER; |
26 | 21 |
27 // static | 22 // static |
28 ProfileKeyedAPIFactory<ThemeAPI>* ThemeAPI::GetFactoryInstance() { | 23 ProfileKeyedAPIFactory<ThemeAPI>* ThemeAPI::GetFactoryInstance() { |
29 return &g_factory.Get(); | 24 return &g_factory.Get(); |
30 } | 25 } |
31 | 26 |
32 } // namespace extensions | 27 } // namespace extensions |
OLD | NEW |