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/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 9 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
10 #include "chrome/browser/spellchecker/spellcheck_service.h" | 10 #include "chrome/browser/spellchecker/spellcheck_service.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 SpellcheckAPI::~SpellcheckAPI() { | 50 SpellcheckAPI::~SpellcheckAPI() { |
51 } | 51 } |
52 | 52 |
53 static base::LazyInstance<ProfileKeyedAPIFactory<SpellcheckAPI> > | 53 static base::LazyInstance<ProfileKeyedAPIFactory<SpellcheckAPI> > |
54 g_factory = LAZY_INSTANCE_INITIALIZER; | 54 g_factory = LAZY_INSTANCE_INITIALIZER; |
55 | 55 |
56 // static | 56 // static |
57 ProfileKeyedAPIFactory<SpellcheckAPI>* SpellcheckAPI::GetFactoryInstance() { | 57 ProfileKeyedAPIFactory<SpellcheckAPI>* SpellcheckAPI::GetFactoryInstance() { |
58 return &g_factory.Get(); | 58 return g_factory.Pointer(); |
59 } | 59 } |
60 | 60 |
61 void SpellcheckAPI::Observe(int type, | 61 void SpellcheckAPI::Observe(int type, |
62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
63 const content::NotificationDetails& details) { | 63 const content::NotificationDetails& details) { |
64 Profile* profile = content::Source<Profile>(source).ptr(); | 64 Profile* profile = content::Source<Profile>(source).ptr(); |
65 SpellcheckService* spellcheck = NULL; | 65 SpellcheckService* spellcheck = NULL; |
66 switch (type) { | 66 switch (type) { |
67 case chrome::NOTIFICATION_EXTENSION_LOADED: { | 67 case chrome::NOTIFICATION_EXTENSION_LOADED: { |
68 const Extension* extension = content::Details<Extension>(details).ptr(); | 68 const Extension* extension = content::Details<Extension>(details).ptr(); |
(...skipping 26 matching lines...) Expand all Loading... |
95 NOTREACHED(); | 95 NOTREACHED(); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 template <> | 99 template <> |
100 void ProfileKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { | 100 void ProfileKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { |
101 DependsOn(SpellcheckServiceFactory::GetInstance()); | 101 DependsOn(SpellcheckServiceFactory::GetInstance()); |
102 } | 102 } |
103 | 103 |
104 } // namespace extensions | 104 } // namespace extensions |
OLD | NEW |