| 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_THEME_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // content::URLDataSource implementation. | 22 // content::URLDataSource implementation. |
| 23 std::string GetSource() const override; | 23 std::string GetSource() const override; |
| 24 void StartDataRequest( | 24 void StartDataRequest( |
| 25 const std::string& path, | 25 const std::string& path, |
| 26 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, | 26 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, |
| 27 const content::URLDataSource::GotDataCallback& callback) override; | 27 const content::URLDataSource::GotDataCallback& callback) override; |
| 28 std::string GetMimeType(const std::string& path) const override; | 28 std::string GetMimeType(const std::string& path) const override; |
| 29 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( | 29 scoped_refptr<base::SingleThreadTaskRunner> TaskRunnerForRequestPath( |
| 30 const std::string& path) const override; | 30 const std::string& path) const override; |
| 31 bool AllowCaching() const override; |
| 31 bool ShouldServiceRequest(const net::URLRequest* request) const override; | 32 bool ShouldServiceRequest(const net::URLRequest* request) const override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 // Fetches and sends the theme bitmap. | 35 // Fetches and sends the theme bitmap. |
| 35 void SendThemeBitmap(const content::URLDataSource::GotDataCallback& callback, | 36 void SendThemeBitmap(const content::URLDataSource::GotDataCallback& callback, |
| 36 int resource_id, | 37 int resource_id, |
| 37 float scale); | 38 float scale); |
| 38 | 39 |
| 39 // Used in place of SendThemeBitmap when the desired scale is larger than | 40 // Used in place of SendThemeBitmap when the desired scale is larger than |
| 40 // what the resource bundle supports. This can rescale the provided bitmap up | 41 // what the resource bundle supports. This can rescale the provided bitmap up |
| 41 // to the desired size. | 42 // to the desired size. |
| 42 void SendThemeImage(const content::URLDataSource::GotDataCallback& callback, | 43 void SendThemeImage(const content::URLDataSource::GotDataCallback& callback, |
| 43 int resource_id, | 44 int resource_id, |
| 44 float scale); | 45 float scale); |
| 45 | 46 |
| 46 // The profile this object was initialized with. | 47 // The profile this object was initialized with. |
| 47 Profile* profile_; | 48 Profile* profile_; |
| 48 | 49 |
| 49 DISALLOW_COPY_AND_ASSIGN(ThemeSource); | 50 DISALLOW_COPY_AND_ASSIGN(ThemeSource); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ | 53 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ |
| OLD | NEW |