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

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

Issue 333603002: Modularize Compact Language Detector 2 (CLD2) data sources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compiler errors Created 6 years, 6 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.h
diff --git a/components/translate/content/browser/data_file_browser_cld_data_provider.h b/components/translate/content/browser/data_file_browser_cld_data_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..b0f70e9247ed40da4e13af35f700865bed1f544f
--- /dev/null
+++ b/components/translate/content/browser/data_file_browser_cld_data_provider.h
@@ -0,0 +1,40 @@
+// 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.
+
+#ifndef CHROME_BROWSER_TRANSLATE_DATA_FILE_BROWSER_CLD_DATA_PROVIDER_H_
+#define CHROME_BROWSER_TRANSLATE_DATA_FILE_BROWSER_CLD_DATA_PROVIDER_H_
Takashi Toyoshima 2014/06/19 10:20:35 macro name
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 Done.
+
+#include "base/files/file.h"
+#include "base/memory/weak_ptr.h"
+#include "components/translate/content/browser/browser_cld_data_provider.h"
+#include "content/public/browser/render_view_host.h"
+
+namespace content {
+
+class DataFileBrowserCldDataProvider : public BrowserCldDataProvider {
+ public:
+ DataFileBrowserCldDataProvider(content::RenderViewHost*);
Takashi Toyoshima 2014/06/19 10:20:35 explicit
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 Done.
+ bool OnMessageReceived(const IPC::Message&);
+ void OnCldDataRequest();
+ void SendCldDataResponse();
+private:
Takashi Toyoshima 2014/06/19 10:20:35 single space before 'private'
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 Done.
+ void SendCldDataResponseInternal(const base::File*,
+ const uint64,
+ const uint64);
+ void OnCldDataRequestInternal();
+
+ content::RenderViewHost* render_view_host;
+ base::WeakPtrFactory<DataFileBrowserCldDataProvider> weak_pointer_factory_;
Takashi Toyoshima 2014/06/19 10:20:34 DISALLOW_COPY_AND_ASSIGN
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 Done.
+};
+
+// Implementation of the static factory method from BrowserCldDataProvider,
Takashi Toyoshima 2014/06/19 10:20:35 Any reason to have this implementation in the head
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 I figured it was an ok place for it, but I was of
+// hooking up this specific implementation for all of Chromium.
+BrowserCldDataProvider* BrowserCldDataProviderFor(
Takashi Toyoshima 2014/06/19 10:20:35 CreateBrowser...() is better name since it starts
Andrew Hayden (chromium.org) 2014/06/19 13:40:20 Done.
+ content::RenderViewHost* render_view_host) {
+ return new DataFileBrowserCldDataProvider(render_view_host);
+}
+
+} // namespace content
+
+#endif // CHROME_BROWSER_TRANSLATE_DATA_FILE_BROWSER_CLD_DATA_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698