| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/file_stream.h" | 10 #include "net/base/file_stream.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 extension_ = service->GetExtensionByURL(page_url); | 69 extension_ = service->GetExtensionByURL(page_url); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void Init() { | 72 void Init() { |
| 73 if (extension_) { | 73 if (extension_) { |
| 74 ExtensionResource icon_resource = | 74 ExtensionResource icon_resource = |
| 75 extension_->GetIconResource(Extension::EXTENSION_ICON_BITTY, | 75 extension_->GetIconResource(Extension::EXTENSION_ICON_BITTY, |
| 76 ExtensionIconSet::MATCH_EXACTLY); | 76 ExtensionIconSet::MATCH_EXACTLY); |
| 77 | 77 |
| 78 tracker_.LoadImage(extension_, icon_resource, | 78 tracker_.LoadImage(extension_, icon_resource, |
| 79 gfx::Size(kFavIconSize, kFavIconSize), | 79 gfx::Size(kFaviconSize, kFaviconSize), |
| 80 ImageLoadingTracker::DONT_CACHE); | 80 ImageLoadingTracker::DONT_CACHE); |
| 81 } else { | 81 } else { |
| 82 ForwardResult(NULL); | 82 ForwardResult(NULL); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource, | 86 virtual void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource, |
| 87 int index) { | 87 int index) { |
| 88 if (image) { | 88 if (image) { |
| 89 std::vector<unsigned char> image_data; | 89 std::vector<unsigned char> image_data; |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 401 } |
| 402 | 402 |
| 403 // static | 403 // static |
| 404 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 404 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
| 405 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 405 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 406 // tracker deletes itself when done. | 406 // tracker deletes itself when done. |
| 407 ExtensionWebUIImageLoadingTracker* tracker = | 407 ExtensionWebUIImageLoadingTracker* tracker = |
| 408 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 408 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
| 409 tracker->Init(); | 409 tracker->Init(); |
| 410 } | 410 } |
| OLD | NEW |