OLD | NEW |
(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 #ifndef CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_FACTORY_H_ |
| 6 #define CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_FACTORY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/translate/cld_data_harness.h" |
| 11 |
| 12 namespace test { |
| 13 |
| 14 class CldDataHarnessFactory { |
| 15 public: |
| 16 CldDataHarnessFactory(); |
| 17 virtual ~CldDataHarnessFactory(); |
| 18 |
| 19 // Create a new CldDataHarness. |
| 20 // The default implementation returns a simple CldDataHarness, which is |
| 21 // likely to be incorrect for most non-static CLD use cases. |
| 22 virtual scoped_ptr<CldDataHarness> CreateCldDataHarness(); |
| 23 |
| 24 // Sets the CldDataHarnessFactory instance for the process. |
| 25 static void Set(CldDataHarnessFactory* instance); |
| 26 |
| 27 // Returns the CldDataHarnessFactory instance previously set for the process. |
| 28 static CldDataHarnessFactory* Get(); |
| 29 |
| 30 // Fetch the global instance of the "none" factory that produces a harness |
| 31 // suitable for use with the "none" CLD data source. |
| 32 static CldDataHarnessFactory* NONE(); |
| 33 |
| 34 // Fetch the global instance of the "static" factory that produces a harness |
| 35 // suitable for use with the "static" CLD data source. |
| 36 static CldDataHarnessFactory* STATIC(); |
| 37 |
| 38 // Fetch the global instance of the "standalone" factory that produces a |
| 39 // harness suitable for use with the "standalone" CLD data source. |
| 40 static CldDataHarnessFactory* STANDALONE(); |
| 41 |
| 42 // Fetch the global instance of the "component" factory that produces a |
| 43 // harness suitable for use with the "component" CLD data source. |
| 44 static CldDataHarnessFactory* COMPONENT(); |
| 45 }; |
| 46 } // namespace test |
| 47 |
| 48 #endif // CHROME_BROWSER_TRANSLATE_CLD_DATA_HARNESS_FACTORY_H_ |
OLD | NEW |