Chromium Code Reviews| Index: components/translate/content/browser/browser_cld_data_provider_factory.h |
| diff --git a/components/translate/content/browser/browser_cld_data_provider_factory.h b/components/translate/content/browser/browser_cld_data_provider_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf6477672d45755ef1b867eca99e935e02fb0b11 |
| --- /dev/null |
| +++ b/components/translate/content/browser/browser_cld_data_provider_factory.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H_ |
| +#define COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H_ |
| + |
| +#include "components/translate/content/browser/browser_cld_data_provider.h" |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace translate { |
| + |
| +class BrowserCldDataProviderFactory { |
| + public: |
| + BrowserCldDataProviderFactory(); |
| + virtual ~BrowserCldDataProviderFactory(); |
| + virtual BrowserCldDataProvider* NewProvider( |
|
jochen (gone - plz use gerrit)
2014/10/23 13:57:39
nit. empty line above this one
Andrew Hayden (chromium.org)
2014/10/30 16:56:32
Done and comments added too.
|
| + content::WebContents* web_contents); |
| + |
| + // Returns true if and only if the current instance for this process is not |
| + // NULL. |
| + static bool IsInitialized(); |
| + |
| + // Sets the instance of the factory used by this process, optionally |
| + // overwriting the previous value. Embedders and narrow use-cases (such as |
| + // shells and test code) should use the overwrite capability, while generic |
| + // code should not. |
| + static void Set(BrowserCldDataProviderFactory* instance, bool overwrite); |
| + |
| + // Returns the instance of the provider previously set by Set(...). |
| + // If no instance has been set, a default no-op provider will be returned. |
| + static BrowserCldDataProviderFactory* Get(); |
| + |
| + // TODO(andrewhayden) reuse pattern used in CldDataSource: NONE, STATIC, ... |
| +}; |
|
jochen (gone - plz use gerrit)
2014/10/23 13:57:39
disallow copy/assign
Andrew Hayden (chromium.org)
2014/10/30 16:56:32
Done.
|
| + |
| +} // namespace translate |
| + |
| +#endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H_ |