Chromium Code Reviews| 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 COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H _ | |
| 6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTORY_H _ | |
| 7 | |
| 8 #include "components/translate/content/browser/browser_cld_data_provider.h" | |
| 9 | |
| 10 namespace content { | |
| 11 class WebContents; | |
| 12 } | |
| 13 | |
| 14 namespace translate { | |
| 15 | |
| 16 class BrowserCldDataProviderFactory { | |
| 17 public: | |
| 18 BrowserCldDataProviderFactory(); | |
| 19 virtual ~BrowserCldDataProviderFactory(); | |
| 20 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.
| |
| 21 content::WebContents* web_contents); | |
| 22 | |
| 23 // Returns true if and only if the current instance for this process is not | |
| 24 // NULL. | |
| 25 static bool IsInitialized(); | |
| 26 | |
| 27 // Sets the instance of the factory used by this process, optionally | |
| 28 // overwriting the previous value. Embedders and narrow use-cases (such as | |
| 29 // shells and test code) should use the overwrite capability, while generic | |
| 30 // code should not. | |
| 31 static void Set(BrowserCldDataProviderFactory* instance, bool overwrite); | |
| 32 | |
| 33 // Returns the instance of the provider previously set by Set(...). | |
| 34 // If no instance has been set, a default no-op provider will be returned. | |
| 35 static BrowserCldDataProviderFactory* Get(); | |
| 36 | |
| 37 // TODO(andrewhayden) reuse pattern used in CldDataSource: NONE, STATIC, ... | |
| 38 }; | |
|
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.
| |
| 39 | |
| 40 } // namespace translate | |
| 41 | |
| 42 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTOR Y_H_ | |
| OLD | NEW |