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/browser/browser_cld_utils.h"
7 #include "base/logging.h"
8 #include "components/translate/content/browser/browser_cld_data_provider_factory.h"
9 #include "components/translate/content/common/cld_data_source.h"
14 void BrowserCldUtils::ConfigureDefaultDataProvider() {
15 if (!BrowserCldDataProviderFactory::IsInitialized()) {
16 DVLOG(1) << "Configuring default BrowserCldDataProviderFactory";
17 BrowserCldDataProviderFactory
* factory
= NULL
;
18 CldDataSource
* data_source
= NULL
;
20 // Maintainers: Customize platform defaults here as necessary.
21 // It is appropriate to ifdef this code and customize per-platform.
23 // Remember to update GYP/GN dependencies of high-level targets as well:
24 // - For the NONE or STATIC data sources, depend upon
25 // third_party/cld_2/cld_2.gyp:cld2_static.
26 // - For the COMPONENT or STANDALONE data sources, depend upon
27 // third_party/cld_2/cld_2.gyp:cld2_dynamic.
28 // - For any other sources, the embedder should already have set a factory
29 // and so this code should never be invoked.
30 // -----------------------------------------------------------------------
31 factory
= new BrowserCldDataProviderFactory();
32 data_source
= CldDataSource::GetStaticDataSource();
33 // -----------------------------------------------------------------------
35 // Apply the values defined above
36 BrowserCldDataProviderFactory::SetDefault(factory
);
37 CldDataSource::SetDefault(data_source
);
41 } // namespace translate