OLD | NEW |
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/api/spellcheck/spellcheck_api.h" | 5 #include "chrome/browser/extensions/api/spellcheck/spellcheck_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 8 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
9 #include "chrome/browser/spellchecker/spellcheck_service.h" | 9 #include "chrome/browser/spellchecker/spellcheck_service.h" |
10 #include "chrome/common/extensions/api/spellcheck/spellcheck_handler.h" | 10 #include "chrome/common/extensions/api/spellcheck/spellcheck_handler.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 SpellcheckAPI::SpellcheckAPI(content::BrowserContext* context) | 41 SpellcheckAPI::SpellcheckAPI(content::BrowserContext* context) |
42 : extension_registry_observer_(this) { | 42 : extension_registry_observer_(this) { |
43 extension_registry_observer_.Add(ExtensionRegistry::Get(context)); | 43 extension_registry_observer_.Add(ExtensionRegistry::Get(context)); |
44 } | 44 } |
45 | 45 |
46 SpellcheckAPI::~SpellcheckAPI() { | 46 SpellcheckAPI::~SpellcheckAPI() { |
47 } | 47 } |
48 | 48 |
49 static base::LazyInstance<BrowserContextKeyedAPIFactory<SpellcheckAPI> > | 49 static base::LazyInstance< |
50 g_factory = LAZY_INSTANCE_INITIALIZER; | 50 BrowserContextKeyedAPIFactory<SpellcheckAPI>>::DestructorAtExit g_factory = |
| 51 LAZY_INSTANCE_INITIALIZER; |
51 | 52 |
52 // static | 53 // static |
53 BrowserContextKeyedAPIFactory<SpellcheckAPI>* | 54 BrowserContextKeyedAPIFactory<SpellcheckAPI>* |
54 SpellcheckAPI::GetFactoryInstance() { | 55 SpellcheckAPI::GetFactoryInstance() { |
55 return g_factory.Pointer(); | 56 return g_factory.Pointer(); |
56 } | 57 } |
57 | 58 |
58 void SpellcheckAPI::OnExtensionLoaded(content::BrowserContext* browser_context, | 59 void SpellcheckAPI::OnExtensionLoaded(content::BrowserContext* browser_context, |
59 const Extension* extension) { | 60 const Extension* extension) { |
60 SpellcheckDictionaryInfo* spellcheck_info = | 61 SpellcheckDictionaryInfo* spellcheck_info = |
(...skipping 23 matching lines...) Expand all Loading... |
84 } | 85 } |
85 } | 86 } |
86 | 87 |
87 template <> | 88 template <> |
88 void | 89 void |
89 BrowserContextKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { | 90 BrowserContextKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { |
90 DependsOn(SpellcheckServiceFactory::GetInstance()); | 91 DependsOn(SpellcheckServiceFactory::GetInstance()); |
91 } | 92 } |
92 | 93 |
93 } // namespace extensions | 94 } // namespace extensions |
OLD | NEW |