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 { | |
Andrew Hayden (chromium.org)
2014/09/26 10:22:49
Needs comments.
Andrew Hayden (chromium.org)
2014/10/28 15:18:39
Done.
| |
17 public: | |
18 BrowserCldDataProviderFactory(); | |
19 virtual ~BrowserCldDataProviderFactory(); | |
20 virtual BrowserCldDataProvider* NewProvider( | |
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 | |
38 } // namespace translate | |
39 | |
40 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_BROWSER_CLD_DATA_PROVIDER_FACTOR Y_H_ | |
OLD | NEW |