| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 FileIconSource(); | 24 FileIconSource(); |
| 25 | 25 |
| 26 // content::URLDataSource implementation. | 26 // content::URLDataSource implementation. |
| 27 std::string GetSource() const override; | 27 std::string GetSource() const override; |
| 28 void StartDataRequest( | 28 void StartDataRequest( |
| 29 const std::string& path, | 29 const std::string& path, |
| 30 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 30 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 31 const content::URLDataSource::GotDataCallback& callback) override; | 31 const content::URLDataSource::GotDataCallback& callback) override; |
| 32 std::string GetMimeType(const std::string&) const override; | 32 std::string GetMimeType(const std::string&) const override; |
| 33 bool AllowCaching() const override; |
| 33 | 34 |
| 34 protected: | 35 protected: |
| 35 ~FileIconSource() override; | 36 ~FileIconSource() override; |
| 36 | 37 |
| 37 // Once the |path| and |icon_size| has been determined from the request, this | 38 // Once the |path| and |icon_size| has been determined from the request, this |
| 38 // function is called to perform the actual fetch. Declared as virtual for | 39 // function is called to perform the actual fetch. Declared as virtual for |
| 39 // testing. | 40 // testing. |
| 40 virtual void FetchFileIcon( | 41 virtual void FetchFileIcon( |
| 41 const base::FilePath& path, | 42 const base::FilePath& path, |
| 42 float scale_factor, | 43 float scale_factor, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 // Called when favicon data is available from the history backend. | 61 // Called when favicon data is available from the history backend. |
| 61 void OnFileIconDataAvailable(const IconRequestDetails& details, | 62 void OnFileIconDataAvailable(const IconRequestDetails& details, |
| 62 gfx::Image* icon); | 63 gfx::Image* icon); |
| 63 | 64 |
| 64 // Tracks tasks requesting file icons. | 65 // Tracks tasks requesting file icons. |
| 65 base::CancelableTaskTracker cancelable_task_tracker_; | 66 base::CancelableTaskTracker cancelable_task_tracker_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(FileIconSource); | 68 DISALLOW_COPY_AND_ASSIGN(FileIconSource); |
| 68 }; | 69 }; |
| 69 #endif // CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ | 70 #endif // CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_ |
| OLD | NEW |