Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: components/translate/content/browser/data_file_browser_cld_data_provider.cc

Issue 424053002: Add a new "Configure" mechanism to CLD browser-side data interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase now that dependencies have landed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/content/browser/data_file_browser_cld_data_provider.cc
diff --git a/components/translate/content/browser/data_file_browser_cld_data_provider.cc b/components/translate/content/browser/data_file_browser_cld_data_provider.cc
index e2eba9326d55e1da508cd6af2e581d02f8b3851d..b7c6853a551b4642df319551c751f8708392b02f 100644
--- a/components/translate/content/browser/data_file_browser_cld_data_provider.cc
+++ b/components/translate/content/browser/data_file_browser_cld_data_provider.cc
@@ -44,6 +44,16 @@ BrowserCldDataProvider* CreateBrowserCldDataProviderFor(
return new DataFileBrowserCldDataProvider(web_contents);
}
+// This implementation requires the parameter to be a pointer to an object
+// of type base::FilePath. A copy will be made and SetCldDataFilePath will
+// be invoked. This allows configuration by the browser for both the
+// "component" and "standalone" data sources without the need to explicitly
+// depend upon one or the other at compile time.
+void ConfigureBrowserCldDataProvider(const void* config) {
+ const base::FilePath* as_path = static_cast<const base::FilePath*>(config);
+ DataFileBrowserCldDataProvider::SetCldDataFilePath(*as_path);
+}
+
void DataFileBrowserCldDataProvider::SetCldDataFilePath(
const base::FilePath& path) {
VLOG(1) << "Setting CLD data file path to: " << path.value();

Powered by Google App Engine
This is Rietveld 408576698