| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // NOT DEAD CODE! | |
| 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 | |
| 8 | |
| 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_ | |
| 11 | |
| 12 #include <stdint.h> | |
| 13 | |
| 14 #include <memory> | |
| 15 | |
| 16 #include "base/files/file.h" | |
| 17 #include "base/files/file_path.h" | |
| 18 #include "base/macros.h" | |
| 19 #include "base/memory/weak_ptr.h" | |
| 20 #include "components/translate/content/browser/browser_cld_data_provider.h" | |
| 21 | |
| 22 namespace content { | |
| 23 class WebContents; | |
| 24 } | |
| 25 | |
| 26 namespace translate { | |
| 27 | |
| 28 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider { | |
| 29 public: | |
| 30 explicit DataFileBrowserCldDataProvider(content::WebContents*); | |
| 31 ~DataFileBrowserCldDataProvider() override; | |
| 32 | |
| 33 // BrowserCldDataProvider implementations: | |
| 34 bool OnMessageReceived(const IPC::Message&) override; | |
| 35 void OnCldDataRequest() override; | |
| 36 void SendCldDataResponse() override; | |
| 37 | |
| 38 private: | |
| 39 void SendCldDataResponseInternal(const base::File*, | |
| 40 const uint64_t, | |
| 41 const uint64_t); | |
| 42 static void OnCldDataRequestInternal(); | |
| 43 | |
| 44 content::WebContents* web_contents_; | |
| 45 std::unique_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider>> | |
| 46 weak_pointer_factory_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider); | |
| 49 }; | |
| 50 | |
| 51 } // namespace translate | |
| 52 | |
| 53 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVI
DER_H_ | |
| OLD | NEW |