Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: chrome/browser/ui/webui/theme_source.h

Issue 2856093004: Generalize content::URLDataSource so that it can be used by the network service. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 11 matching lines...) Expand all
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 AllowCaching() const override;
32 bool ShouldServiceRequest(const net::URLRequest* request) const override; 32 bool ShouldServiceRequest(const GURL& url,
33 content::ResourceContext* resource_context,
34 int render_process_id) const override;
33 35
34 private: 36 private:
35 // Fetches and sends the theme bitmap. 37 // Fetches and sends the theme bitmap.
36 void SendThemeBitmap(const content::URLDataSource::GotDataCallback& callback, 38 void SendThemeBitmap(const content::URLDataSource::GotDataCallback& callback,
37 int resource_id, 39 int resource_id,
38 float scale); 40 float scale);
39 41
40 // Used in place of SendThemeBitmap when the desired scale is larger than 42 // Used in place of SendThemeBitmap when the desired scale is larger than
41 // what the resource bundle supports. This can rescale the provided bitmap up 43 // what the resource bundle supports. This can rescale the provided bitmap up
42 // to the desired size. 44 // to the desired size.
43 void SendThemeImage(const content::URLDataSource::GotDataCallback& callback, 45 void SendThemeImage(const content::URLDataSource::GotDataCallback& callback,
44 int resource_id, 46 int resource_id,
45 float scale); 47 float scale);
46 48
47 // The profile this object was initialized with. 49 // The profile this object was initialized with.
48 Profile* profile_; 50 Profile* profile_;
49 51
50 DISALLOW_COPY_AND_ASSIGN(ThemeSource); 52 DISALLOW_COPY_AND_ASSIGN(ThemeSource);
51 }; 53 };
52 54
53 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_ 55 #endif // CHROME_BROWSER_UI_WEBUI_THEME_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698