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

Side by Side Diff: components/translate/content/browser/data_file_browser_cld_data_provider.h

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_ 5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_
6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_ 6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER _H_
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "components/translate/content/browser/browser_cld_data_provider.h" 13 #include "components/translate/content/browser/browser_cld_data_provider.h"
14 14
15 namespace content {
16 class WebContents;
17 }
18
15 namespace translate { 19 namespace translate {
16 20
17 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider { 21 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider {
18 public: 22 public:
19 explicit DataFileBrowserCldDataProvider(content::WebContents*); 23 explicit DataFileBrowserCldDataProvider(content::WebContents*);
20 virtual ~DataFileBrowserCldDataProvider(); 24 ~DataFileBrowserCldDataProvider() override;
25
21 // BrowserCldDataProvider implementations: 26 // BrowserCldDataProvider implementations:
22 virtual bool OnMessageReceived(const IPC::Message&) override; 27 bool OnMessageReceived(const IPC::Message&) override;
23 virtual void OnCldDataRequest() override; 28 void OnCldDataRequest() override;
24 virtual void SendCldDataResponse() override; 29 void SendCldDataResponse() override;
25 30
26 private: 31 private:
27 void SendCldDataResponseInternal(const base::File*, 32 void SendCldDataResponseInternal(const base::File*,
28 const uint64, 33 const uint64,
29 const uint64); 34 const uint64);
30 static void OnCldDataRequestInternal(); 35 static void OnCldDataRequestInternal();
31 36
32 content::WebContents* web_contents_; 37 content::WebContents* web_contents_;
33 scoped_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider> > 38 scoped_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider> >
34 weak_pointer_factory_; 39 weak_pointer_factory_;
35 40
36 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider); 41 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider);
37 }; 42 };
38 43
39 } // namespace translate 44 } // namespace translate
40 45
41 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI DER_H_ 46 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698