15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// found in the LICENSE file. 45f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#ifndef COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 65f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#define COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 75f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 85f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include <string> 95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace translate { 115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Provides high-level functionality related to a CLD Data Source. 135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class CldDataSource { 145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) public: 165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // Returns the symbolic name of the data source. In the Chromium 185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // open-source tree, the following data sources exist: 195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // static uses the static_[browser|renderer]_cld_data_provider 205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // implementations. 215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // standalone uses the data_file_[browser|renderer]_cld_data_provider 225f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // implementations. 235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // component also uses the data_file_[browser|renderer]_cld_data_provider 245f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // implementations. 255f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // 265f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // Other implementations based upon Chromium may provide CLD differently and 275f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // may have other names. This method is primarily provided for those 285f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // non-Chromium implementations; Chromium implementations should use the 295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // boolean methods in this class instead: 305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // ShouldRegisterForComponentUpdates() 315f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // ShouldUseStandaloneDataFile() 325f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) static std::string GetName(); 335f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 345f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // Returns true if the data source needs to receive updates from the 355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // Component Updater. 365f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // This is only true if the data source name is "component", but makes caller 375f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // logic more generic. 385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) static bool ShouldRegisterForComponentUpdates(); 395f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 405f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // Returns true if the data source needs to have the path to the CLD 415f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // data file configured immediately because it is bundled with Chromium. 425f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // This is only true if the data source name is "standalone", but makes 435f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) // caller logic more generic. 445f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) static bool ShouldUseStandaloneDataFile(); 455f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)}; 465f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 475f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)} // namespace translate 485f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#endif // COMPONENTS_TRANSLATE_CONTENT_COMMON_CLD_DATA_SOURCE_H_ 49