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

Side by Side Diff: chrome/browser/extensions/extension_web_ui.cc

Issue 10870022: Change FaviconData to be able to return data for multiple bitmaps for same icon URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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 #include "chrome/browser/extensions/extension_web_ui.h" 5 #include "chrome/browser/extensions/extension_web_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 } 125 }
126 126
127 private: 127 private:
128 ~ExtensionWebUIImageLoadingTracker() {} 128 ~ExtensionWebUIImageLoadingTracker() {}
129 129
130 // Forwards the result on the request. If no favicon was available then 130 // Forwards the result on the request. If no favicon was available then
131 // |icon_data| may be backed by NULL. Once the result has been forwarded the 131 // |icon_data| may be backed by NULL. Once the result has been forwarded the
132 // instance is deleted. 132 // instance is deleted.
133 void ForwardResult(scoped_refptr<base::RefCountedMemory> icon_data) { 133 void ForwardResult(scoped_refptr<base::RefCountedMemory> icon_data) {
134 history::FaviconData favicon; 134 history::FaviconData favicon_data;
135 favicon.known_icon = icon_data.get() != NULL && icon_data->size() > 0; 135 favicon_data.known_icon = icon_data.get() != NULL && icon_data->size() > 0;
136 favicon.image_data = icon_data; 136 favicon_data.icon_type = history::FAVICON;
137 favicon.icon_type = history::FAVICON; 137 history::FaviconBitmapData favicon_bitmap_data;
138 request_->ForwardResultAsync(request_->handle(), favicon); 138 favicon_bitmap_data.bitmap_data = icon_data;
139 favicon_data.bitmaps.push_back(favicon_bitmap_data);
140 request_->ForwardResultAsync(request_->handle(), favicon_data,
141 std::vector<GURL>());
139 delete this; 142 delete this;
140 } 143 }
141 144
142 ImageLoadingTracker tracker_; 145 ImageLoadingTracker tracker_;
143 scoped_refptr<FaviconService::GetFaviconRequest> request_; 146 scoped_refptr<FaviconService::GetFaviconRequest> request_;
144 const Extension* extension_; 147 const Extension* extension_;
145 148
146 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIImageLoadingTracker); 149 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIImageLoadingTracker);
147 }; 150 };
148 151
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 } 425 }
423 426
424 // static 427 // static
425 void ExtensionWebUI::GetFaviconForURL(Profile* profile, 428 void ExtensionWebUI::GetFaviconForURL(Profile* profile,
426 FaviconService::GetFaviconRequest* request, const GURL& page_url) { 429 FaviconService::GetFaviconRequest* request, const GURL& page_url) {
427 // tracker deletes itself when done. 430 // tracker deletes itself when done.
428 ExtensionWebUIImageLoadingTracker* tracker = 431 ExtensionWebUIImageLoadingTracker* tracker =
429 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); 432 new ExtensionWebUIImageLoadingTracker(profile, request, page_url);
430 tracker->Init(); 433 tracker->Init();
431 } 434 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698