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

Side by Side Diff: chrome/browser/ui/webui/large_icon_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LARGE_ICON_SOURCE_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ 6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // content::URLDataSource implementation. 47 // content::URLDataSource implementation.
48 std::string GetSource() const override; 48 std::string GetSource() const override;
49 void StartDataRequest( 49 void StartDataRequest(
50 const std::string& path, 50 const std::string& path,
51 const content::ResourceRequestInfo::WebContentsGetter& wc_getter, 51 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
52 const content::URLDataSource::GotDataCallback& callback) override; 52 const content::URLDataSource::GotDataCallback& callback) override;
53 std::string GetMimeType(const std::string&) const override; 53 std::string GetMimeType(const std::string&) const override;
54 bool AllowCaching() const override; 54 bool AllowCaching() const override;
55 bool ShouldReplaceExistingSource() const override; 55 bool ShouldReplaceExistingSource() const override;
56 bool ShouldServiceRequest(const net::URLRequest* request) const override; 56 bool ShouldServiceRequest(const GURL& url,
57 content::ResourceContext* resource_context,
58 int render_process_id) const override;
57 59
58 private: 60 private:
59 // Called with results of large icon retrieval request. 61 // Called with results of large icon retrieval request.
60 void OnLargeIconDataAvailable( 62 void OnLargeIconDataAvailable(
61 const content::URLDataSource::GotDataCallback& callback, 63 const content::URLDataSource::GotDataCallback& callback,
62 const GURL& url, 64 const GURL& url,
63 int size, 65 int size,
64 const favicon_base::LargeIconResult& bitmap_result); 66 const favicon_base::LargeIconResult& bitmap_result);
65 67
66 // Returns null to trigger "Not Found" response. 68 // Returns null to trigger "Not Found" response.
67 void SendNotFoundResponse( 69 void SendNotFoundResponse(
68 const content::URLDataSource::GotDataCallback& callback); 70 const content::URLDataSource::GotDataCallback& callback);
69 71
70 base::CancelableTaskTracker cancelable_task_tracker_; 72 base::CancelableTaskTracker cancelable_task_tracker_;
71 73
72 // Owned by client. 74 // Owned by client.
73 favicon::FallbackIconService* fallback_icon_service_; 75 favicon::FallbackIconService* fallback_icon_service_;
74 76
75 // Owned by client. 77 // Owned by client.
76 favicon::LargeIconService* large_icon_service_; 78 favicon::LargeIconService* large_icon_service_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(LargeIconSource); 80 DISALLOW_COPY_AND_ASSIGN(LargeIconSource);
79 }; 81 };
80 82
81 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_ 83 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698