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

Side by Side Diff: components/translate/content/common/cld_data_source.h

Issue 424123003: Replace the use of CLD_DATA_FROM* and CLD-related ifdefs with runtime checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
6 #define COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 6 #define COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace translate { 10 namespace translate {
11 11
12 // Provides high-level functionality related to a CLD Data Source. 12 // Provides high-level functionality related to a CLD Data Source.
13 class CldDataSource { 13 class CldDataSource {
14 14
15 public: 15 public:
16 16
17 // Returns the symbolic name of the data source. In the Chromium 17 // Returns the symbolic name of the data source. In the Chromium
18 // open-source tree, the following data sources exist: 18 // open-source tree, the following data sources exist:
19 // static uses the static_[browser|renderer]_cld_data_provider 19 // static uses the static_[browser|renderer]_cld_data_provider
20 // implementations. 20 // implementations.
21 // standalone uses the data_file_[browser|renderer]_cld_data_provider 21 // standalone uses the data_file_[browser|renderer]_cld_data_provider
22 // implementations. 22 // implementations.
23 // component also uses the data_file_[browser|renderer]_cld_data_provider 23 // component also uses the data_file_[browser|renderer]_cld_data_provider
24 // implementations. 24 // implementations.
25 // 25 //
26 // Other implementations based upon Chromium may provide CLD differently and 26 // Other implementations based upon Chromium may provide CLD differently and
27 // may have other names. 27 // may have other names. This method is primarily provided for those
28 // non-Chromium implementations; Chromium implementations should use the
29 // boolean methods in this class instead:
30 // ShouldRegisterForComponentUpdates()
31 // ShouldUseStandaloneDataFile()
28 static std::string GetName(); 32 static std::string GetName();
29 33
34 // Returns true if the data source needs to receive updates from the
35 // Component Updater.
36 // This is only true if the data source name is "component", but makes caller
37 // logic more generic.
38 static bool ShouldRegisterForComponentUpdates();
39
40 // Returns true if the data source needs to have the path to the CLD
41 // data file configured immediately because it is bundled with Chromium.
42 // This is only true if the data source name is "standalone", but makes
43 // caller logic more generic.
44 static bool ShouldUseStandaloneDataFile();
30 }; 45 };
31 46
32 } // namespace translate 47 } // namespace translate
33 #endif // COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 48 #endif // COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | components/translate/content/common/component_cld_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698