Home | History | Annotate | Download | only in browser
      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 #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_
      7 
      8 #include "base/files/file.h"
      9 #include "base/files/file_path.h"
     10 #include "base/macros.h"
     11 #include "base/memory/scoped_ptr.h"
     12 #include "base/memory/weak_ptr.h"
     13 #include "components/translate/content/browser/browser_cld_data_provider.h"
     14 
     15 namespace translate {
     16 
     17 class DataFileBrowserCldDataProvider : public BrowserCldDataProvider {
     18  public:
     19   explicit DataFileBrowserCldDataProvider(content::WebContents*);
     20   virtual ~DataFileBrowserCldDataProvider();
     21   // BrowserCldDataProvider implementations:
     22   virtual bool OnMessageReceived(const IPC::Message&) OVERRIDE;
     23   virtual void OnCldDataRequest() OVERRIDE;
     24   virtual void SendCldDataResponse() OVERRIDE;
     25 
     26  private:
     27   void SendCldDataResponseInternal(const base::File*,
     28                                    const uint64,
     29                                    const uint64);
     30   static void OnCldDataRequestInternal();
     31 
     32   content::WebContents* web_contents_;
     33   scoped_ptr<base::WeakPtrFactory<DataFileBrowserCldDataProvider> >
     34       weak_pointer_factory_;
     35 
     36   DISALLOW_COPY_AND_ASSIGN(DataFileBrowserCldDataProvider);
     37 };
     38 
     39 }  // namespace translate
     40 
     41 #endif  // COMPONENTS_TRANSLATE_CONTENT_BROWSER_DATA_FILE_BROWSER_CLD_DATA_PROVIDER_H_
     42