Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / translate / content / renderer / renderer_cld_utils.h
blobe2eeb2013a42be9baa210bfe3f547f96c49611a1
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.
5 #ifndef COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_UTILS_H_
6 #define COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_UTILS_H_
8 #include "base/macros.h"
10 namespace translate {
12 // Renderer-side utilities for dealing with CLD data source configuration.
13 // This class exists primarily to avoid duplicating code in high-level targets
14 // such as the Chrome browser, Chrome shell, and so on.
15 class RendererCldUtils {
16 public:
17 // Perform conditional configuration of the CLD data provider.
18 // If no specific RendererCldDataProvider has yet been set, an instance is
19 // created and assigned as appropriate for each platform. If a specific
20 // RendererCldDataProviderFactory *has* been set, this method does nothing
21 // (as a side effect of setting the default factory, subsequent invocations
22 // do nothing - making this method reentrant).
24 // This method will not overwrite a data provider configured by an embedder.
26 // Maintainers: This is the default data source. It is appropriate to
27 // ifdef this code and customize the default per-platform. This method must
28 // be invoked prior to registering components with the component updater if
29 // the component updater implementation is to be used; it is best to ensure
30 // that this method is called as early as possible.
31 static void ConfigureDefaultDataProvider();
33 private:
34 RendererCldUtils() {}
35 ~RendererCldUtils() {}
36 DISALLOW_COPY_AND_ASSIGN(RendererCldUtils);
39 } // namespace translate
41 #endif // COMPONENTS_TRANSLATE_CONTENT_RENDERER_RENDERER_CLD_UTILS_H_