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..d41d0c7aee163aa261afb632f144611bec7a3b84 |
| --- /dev/null |
| +++ b/components/translate/content/browser/browser_cld_data_provider_factory.h |
| @@ -0,0 +1,40 @@ |
| +// 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 { |
|
Andrew Hayden (chromium.org)
2014/09/26 10:22:49
Needs comments.
Andrew Hayden (chromium.org)
2014/10/28 15:18:39
Done.
|
| + public: |
| + BrowserCldDataProviderFactory(); |
| + virtual ~BrowserCldDataProviderFactory(); |
| + virtual BrowserCldDataProvider* NewProvider( |
| + 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(); |
| +}; |
| + |
| +} // namespace translate |
| + |
| +#endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H_ |