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

Side by Side Diff: components/translate/content/browser/browser_cld_utils.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(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/browser/browser_cld_utils.h"
6
7 #include "components/translate/content/browser/browser_cld_data_provider_factory .h"
8 #include "components/translate/content/common/cld_data_source.h"
9
10 namespace translate {
11
12 // static
13 void BrowserCldUtils::ConfigureDefaultDataProvider() {
14 if (!BrowserCldDataProviderFactory::IsInitialized()) {
15 BrowserCldDataProviderFactory* factory = 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 factory
27 // and so this code should never be invoked.
28 // -----------------------------------------------------------------------
29 factory = new BrowserCldDataProviderFactory();
30 data_source = CldDataSource::GetStaticDataSource();
31 // -----------------------------------------------------------------------
32
33 // Apply the values defined above
34 BrowserCldDataProviderFactory::SetDefault(factory);
35 CldDataSource::SetDefault(data_source);
36 }
37 }
38
39 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698