| OLD | NEW |
| 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 // NOT DEAD CODE! | 5 // NOT DEAD CODE! |
| 6 // This code isn't dead, even if it isn't currently being used. Please refer to: | 6 // This code isn't dead, even if it isn't currently being used. Please refer to: |
| 7 // https://www.chromium.org/developers/how-tos/compact-language-detector-cld-dat
a-source-configuration | 7 // https://www.chromium.org/developers/how-tos/compact-language-detector-cld-dat
a-source-configuration |
| 8 | 8 |
| 9 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER
_H_ | 9 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER
_H_ |
| 10 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER
_H_ | 10 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER
_H_ |
| 11 | 11 |
| 12 #include <stdint.h> |
| 13 |
| 12 #include "base/files/file.h" | 14 #include "base/files/file.h" |
| 13 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 16 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 17 #include "components/translate/content/browser/browser_cld_data_provider.h" | 19 #include "components/translate/content/browser/browser_cld_data_provider.h" |
| 18 | 20 |
| 19 namespace content { | 21 namespace content { |
| 20 class WebContents; | 22 class WebContents; |
| 21 } | 23 } |
| 22 | 24 |
| 23 namespace translate { | 25 namespace translate { |
| 24 | 26 |
| 25 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider { | 27 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider { |
| 26 public: | 28 public: |
| 27 explicit DataFileBrowserCldDataProvider(content::WebContents*); | 29 explicit DataFileBrowserCldDataProvider(content::WebContents*); |
| 28 ~DataFileBrowserCldDataProvider() override; | 30 ~DataFileBrowserCldDataProvider() override; |
| 29 | 31 |
| 30 // BrowserCldDataProvider implementations: | 32 // BrowserCldDataProvider implementations: |
| 31 bool OnMessageReceived(const IPC::Message&) override; | 33 bool OnMessageReceived(const IPC::Message&) override; |
| 32 void OnCldDataRequest() override; | 34 void OnCldDataRequest() override; |
| 33 void SendCldDataResponse() override; | 35 void SendCldDataResponse() override; |
| 34 | 36 |
| 35 private: | 37 private: |
| 36 void SendCldDataResponseInternal(const base::File*, | 38 void SendCldDataResponseInternal(const base::File*, |
| 37 const uint64, | 39 const uint64_t, |
| 38 const uint64); | 40 const uint64_t); |
| 39 static void OnCldDataRequestInternal(); | 41 static void OnCldDataRequestInternal(); |
| 40 | 42 |
| 41 content::WebContents* web_contents_; | 43 content::WebContents* web_contents_; |
| 42 scoped_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider> > | 44 scoped_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider> > |
| 43 weak_pointer_factory_; | 45 weak_pointer_factory_; |
| 44 | 46 |
| 45 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider); | 47 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider); |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 } // namespace translate | 50 } // namespace translate |
| 49 | 51 |
| 50 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI
DER_H_ | 52 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI
DER_H_ |
| OLD | NEW |