OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/translate/content/renderer/renderer_cld_utils.h" |
| 6 |
| 7 #include "components/translate/content/common/cld_data_source.h" |
| 8 #include "components/translate/content/renderer/renderer_cld_data_provider.h" |
| 9 |
| 10 namespace translate { |
| 11 |
| 12 // static |
| 13 void RendererCldUtils::ConfigureDefaultDataProvider() { |
| 14 if (!RendererCldDataProvider::IsInitialized()) { |
| 15 RendererCldDataProvider* provider = NULL; |
| 16 CldDataSource* data_source = NULL; |
| 17 |
| 18 // Maintainers: Customize platform defaults here as necessary. |
| 19 // It is appropriate to ifdef this code and customize per-platform. |
| 20 // |
| 21 // Remember to update GYP/GN dependencies of high-level targets as well: |
| 22 // - For the NONE or STATIC data sources, depend upon |
| 23 // third_party/cld_2/cld_2.gyp:cld2_static. |
| 24 // - For the COMPONENT or STANDALONE data sources, depend upon |
| 25 // third_party/cld_2/cld_2.gyp:cld2_dynamic. |
| 26 // - For any other sources, the embedder should already have set a provider |
| 27 // and so this code should never be invoked. |
| 28 // ----------------------------------------------------------------------- |
| 29 provider = new RendererCldDataProvider(); |
| 30 data_source = CldDataSource::GetStaticDataSource(); |
| 31 // ----------------------------------------------------------------------- |
| 32 |
| 33 // Apply the values defined above |
| 34 RendererCldDataProvider::SetDefault(provider); |
| 35 CldDataSource::SetDefault(data_source); |
| 36 } |
| 37 } |
| 38 |
| 39 } // namespace translate |
OLD | NEW |