Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / translate / content / renderer / renderer_cld_utils.cc
blobaaa9728dca51eb43fad392716d9d6f4c8ce708ac
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.
5 #include "components/translate/content/renderer/renderer_cld_utils.h"
7 #include "base/logging.h"
8 #include "components/translate/content/common/cld_data_source.h"
9 #include "components/translate/content/renderer/renderer_cld_data_provider.h"
10 #include "components/translate/content/renderer/renderer_cld_data_provider_factory.h"
12 namespace translate {
14 // static
15 void RendererCldUtils::ConfigureDefaultDataProvider() {
16 if (!RendererCldDataProviderFactory::IsInitialized()) {
17 DVLOG(1) << "Configuring default RendererCldDataProviderFactory";
18 RendererCldDataProviderFactory* factory = NULL;
19 CldDataSource* data_source = NULL;
21 // Maintainers: Customize platform defaults here as necessary.
22 // It is appropriate to ifdef this code and customize per-platform.
24 // Remember to update GYP/GN dependencies of high-level targets as well:
25 // - For the NONE or STATIC data sources, depend upon
26 // third_party/cld_2/cld_2.gyp:cld2_static.
27 // - For the COMPONENT or STANDALONE data sources, depend upon
28 // third_party/cld_2/cld_2.gyp:cld2_dynamic.
29 // - For any other sources, the embedder should already have set a provider
30 // and so this code should never be invoked.
31 // -----------------------------------------------------------------------
32 factory = new RendererCldDataProviderFactory();
33 data_source = CldDataSource::GetStaticDataSource();
34 // -----------------------------------------------------------------------
36 // Apply the values defined above
37 RendererCldDataProviderFactory::SetDefault(factory);
38 CldDataSource::SetDefault(data_source);
42 } // namespace translate