| 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/i18n/i18n_api.h" | 5 #include "chrome/browser/extensions/api/i18n/i18n_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 error_ = kEmptyAcceptLanguagesError; | 57 error_ = kEmptyAcceptLanguagesError; |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 results_ = GetAcceptLanguages::Results::Create(languages); | 61 results_ = GetAcceptLanguages::Results::Create(languages); |
| 62 return true; | 62 return true; |
| 63 } | 63 } |
| 64 | 64 |
| 65 I18nAPI::I18nAPI(Profile* profile) { | 65 I18nAPI::I18nAPI(Profile* profile) { |
| 66 ManifestHandler::Register(extension_manifest_keys::kDefaultLocale, | 66 ManifestHandler::Register(extension_manifest_keys::kDefaultLocale, |
| 67 new DefaultLocaleHandler); | 67 make_linked_ptr(new DefaultLocaleHandler)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 I18nAPI::~I18nAPI() { | 70 I18nAPI::~I18nAPI() { |
| 71 } | 71 } |
| 72 | 72 |
| 73 static base::LazyInstance<ProfileKeyedAPIFactory<I18nAPI> > | 73 static base::LazyInstance<ProfileKeyedAPIFactory<I18nAPI> > |
| 74 g_factory = LAZY_INSTANCE_INITIALIZER; | 74 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 75 | 75 |
| 76 // static | 76 // static |
| 77 ProfileKeyedAPIFactory<I18nAPI>* I18nAPI::GetFactoryInstance() { | 77 ProfileKeyedAPIFactory<I18nAPI>* I18nAPI::GetFactoryInstance() { |
| 78 return &g_factory.Get(); | 78 return &g_factory.Get(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace extensions | 81 } // namespace extensions |
| OLD | NEW |