Chromium Code Reviews| Index: components/translate/content/browser/browser_cld_utils.cc |
| diff --git a/components/translate/content/browser/browser_cld_utils.cc b/components/translate/content/browser/browser_cld_utils.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c806e78632379d38e8e227ac18c4a67324bf520b |
| --- /dev/null |
| +++ b/components/translate/content/browser/browser_cld_utils.cc |
| @@ -0,0 +1,37 @@ |
| +// 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. |
| + |
| +#include "components/translate/content/browser/browser_cld_utils.h" |
| + |
| +#include "components/translate/content/browser/browser_cld_data_provider_factory.h" |
| +#include "components/translate/content/browser/static_browser_cld_data_provider_factory.h" |
| +#include "components/translate/content/common/cld_data_source.h" |
| + |
| +namespace translate { |
| + |
| +/* static */ void BrowserCldUtils::ConfigureDefaultDataProvider() { |
|
Takashi Toyoshima
2014/10/15 08:45:07
// static
void BrowserCldUtils::...
Andrew Hayden (chromium.org)
2014/10/30 16:56:32
Done.
|
| + if (!BrowserCldDataProviderFactory::IsInitialized()) { |
| + BrowserCldDataProviderFactory* factory = NULL; |
| + CldDataSource* data_source = NULL; |
| + |
| + // Maintainers: Customize platform defaults here as necessary. |
| + // Remember to update GYP/GN dependencies of high-level targets as well: |
| + // - For the NONE or STATIC data sources, depend upon |
| + // third_party/cld_2/cld_2.gyp:cld2_static. |
| + // - For the COMPONENT or STANDALONE data sources, depend upon |
| + // third_party/cld_2/cld_2.gyp:cld2_dynamic. |
| + // - For any other sources, the embedder should already have set a factory |
| + // and so this code should never be invoked. |
| + // ----------------------------------------------------------------------- |
| + factory = new StaticBrowserCldDataProviderFactory(); |
| + data_source = CldDataSource::STATIC(); |
| + // ----------------------------------------------------------------------- |
| + |
| + // Apply the values defined above |
| + BrowserCldDataProviderFactory::Set(factory, false); |
| + CldDataSource::Set(data_source, false); |
| + } |
| +} |
| + |
| +} // namespace translate |