Home | History | Annotate | Download | only in common
      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 #ifndef COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
      6 #define COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
      7 
      8 #include <string>
      9 
     10 namespace translate {
     11 
     12 // Provides high-level functionality related to a CLD Data Source.
     13 class CldDataSource {
     14 
     15  public:
     16 
     17   // Returns the symbolic name of the data source. In the Chromium
     18   // open-source tree, the following data sources exist:
     19   // static       uses the static_[browser|renderer]_cld_data_provider
     20   //              implementations.
     21   // standalone   uses the data_file_[browser|renderer]_cld_data_provider
     22   //              implementations.
     23   // component    also uses the data_file_[browser|renderer]_cld_data_provider
     24   //              implementations.
     25   //
     26   // Other implementations based upon Chromium may provide CLD differently and
     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()
     32   static std::string GetName();
     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();
     45 };
     46 
     47 }  // namespace translate
     48 #endif  // COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_
     49