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

Side by Side Diff: chrome/browser/extensions/api/spellcheck/spellcheck_api.cc

Issue 265703011: cleanup: pass string as const reference from c/b/extension/api (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header file for base::EmptyString() Created 6 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
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/removable_storage_provider_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "extensions/browser/extension_registry.h" 11 #include "extensions/browser/extension_registry.h"
12 #include "extensions/common/manifest_constants.h" 12 #include "extensions/common/manifest_constants.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 namespace errors = manifest_errors; 16 namespace errors = manifest_errors;
17 17
18 namespace { 18 namespace {
19 19
20 SpellcheckDictionaryInfo* GetSpellcheckDictionaryInfo( 20 SpellcheckDictionaryInfo* GetSpellcheckDictionaryInfo(
21 const Extension* extension) { 21 const Extension* extension) {
22 SpellcheckDictionaryInfo *spellcheck_info = 22 SpellcheckDictionaryInfo *spellcheck_info =
23 static_cast<SpellcheckDictionaryInfo*>( 23 static_cast<SpellcheckDictionaryInfo*>(
24 extension->GetManifestData(manifest_keys::kSpellcheck)); 24 extension->GetManifestData(manifest_keys::kSpellcheck));
25 return spellcheck_info; 25 return spellcheck_info;
26 } 26 }
27 27
28 SpellcheckService::DictionaryFormat GetDictionaryFormat(std::string format) { 28 SpellcheckService::DictionaryFormat GetDictionaryFormat(
29 const std::string& format) {
29 if (format == "hunspell") { 30 if (format == "hunspell") {
30 return SpellcheckService::DICT_HUNSPELL; 31 return SpellcheckService::DICT_HUNSPELL;
31 } else if (format == "text") { 32 } else if (format == "text") {
32 return SpellcheckService::DICT_TEXT; 33 return SpellcheckService::DICT_TEXT;
33 } else { 34 } else {
34 return SpellcheckService::DICT_UNKNOWN; 35 return SpellcheckService::DICT_UNKNOWN;
35 } 36 }
36 } 37 }
37 38
38 } // namespace 39 } // namespace
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 } 85 }
85 86
86 template <> 87 template <>
87 void 88 void
88 BrowserContextKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() { 89 BrowserContextKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies() {
89 DependsOn(SpellcheckServiceFactory::GetInstance()); 90 DependsOn(SpellcheckServiceFactory::GetInstance());
90 } 91 }
91 92
92 } // namespace extensions 93 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/image_writer_private/removable_storage_provider_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698