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

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

Issue 2917733002: Remove unused chrome://large-icon (Closed)
Patch Set: Created 3 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
6 #define CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/task/cancelable_task_tracker.h"
13 #include "content/public/browser/url_data_source.h"
14
15 namespace favicon {
16 class LargeIconService;
17 }
18
19 namespace favicon_base {
20 struct LargeIconResult;
21 }
22
23 // LargeIconSource services explicit chrome:// requests for large icons.
24 //
25 // Format:
26 // chrome://large-icon/size/url
27 //
28 // Parameter:
29 // 'size' Required (including trailing '/')
30 // Positive integer to specify the large icon's size in pixels.
31 // 'url' Optional
32 // String to specify the page URL of the large icon.
33 //
34 // Example: chrome://large-icon/48/http://www.google.com/
35 // This requests a 48x48 large icon for http://www.google.com.
36 class LargeIconSource : public content::URLDataSource {
37 public:
38 // |large_icon_service| is owned by caller and may be null.
39 explicit LargeIconSource(favicon::LargeIconService* large_icon_service);
40
41 ~LargeIconSource() override;
42
43 // content::URLDataSource implementation.
44 std::string GetSource() const override;
45 void StartDataRequest(
46 const std::string& path,
47 const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
48 const content::URLDataSource::GotDataCallback& callback) override;
49 std::string GetMimeType(const std::string&) const override;
50 bool AllowCaching() const override;
51 bool ShouldReplaceExistingSource() const override;
52 bool ShouldServiceRequest(const GURL& url,
53 content::ResourceContext* resource_context,
54 int render_process_id) const override;
55
56 private:
57 // Called with results of large icon retrieval request.
58 void OnLargeIconDataAvailable(
59 const content::URLDataSource::GotDataCallback& callback,
60 const GURL& url,
61 int size,
62 const favicon_base::LargeIconResult& bitmap_result);
63
64 // Returns null to trigger "Not Found" response.
65 void SendNotFoundResponse(
66 const content::URLDataSource::GotDataCallback& callback);
67
68 base::CancelableTaskTracker cancelable_task_tracker_;
69
70 // Owned by client.
71 favicon::LargeIconService* large_icon_service_;
72
73 DISALLOW_COPY_AND_ASSIGN(LargeIconSource);
74 };
75
76 #endif // CHROME_BROWSER_UI_WEBUI_LARGE_ICON_SOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/browsing_history_handler.cc ('k') | chrome/browser/ui/webui/large_icon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698