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

Side by Side Diff: chrome/browser/extensions/api/spellcheck/spellcheck_api.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/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 20 matching lines...) Expand all
31 return SpellcheckService::DICT_TEXT; 31 return SpellcheckService::DICT_TEXT;
32 } else { 32 } else {
33 return SpellcheckService::DICT_UNKNOWN; 33 return SpellcheckService::DICT_UNKNOWN;
34 } 34 }
35 } 35 }
36 36
37 } // namespace 37 } // namespace
38 38
39 39
40 SpellcheckAPI::SpellcheckAPI(Profile* profile) { 40 SpellcheckAPI::SpellcheckAPI(Profile* profile) {
41 (new SpellcheckHandler)->Register();
42 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 41 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
43 content::Source<Profile>(profile)); 42 content::Source<Profile>(profile));
44 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 43 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
45 content::Source<Profile>(profile)); 44 content::Source<Profile>(profile));
46 } 45 }
47 46
48 SpellcheckAPI::~SpellcheckAPI() { 47 SpellcheckAPI::~SpellcheckAPI() {
49 } 48 }
50 49
51 static base::LazyInstance<ProfileKeyedAPIFactory<SpellcheckAPI> > 50 static base::LazyInstance<ProfileKeyedAPIFactory<SpellcheckAPI> >
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 NOTREACHED(); 92 NOTREACHED();
94 } 93 }
95 } 94 }
96 95
97 template <> 96 template <>
98 void ProfileKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { 97 void ProfileKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() {
99 DependsOn(SpellcheckServiceFactory::GetInstance()); 98 DependsOn(SpellcheckServiceFactory::GetInstance());
100 } 99 }
101 100
102 } // namespace extensions 101 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698