| OLD | NEW |
| 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/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Even when the extensions service is enabled by default, it's still | 90 // Even when the extensions service is enabled by default, it's still |
| 91 // disabled in incognito mode. | 91 // disabled in incognito mode. |
| 92 ExtensionService* service = profile->GetExtensionService(); | 92 ExtensionService* service = profile->GetExtensionService(); |
| 93 if (service) | 93 if (service) |
| 94 extension_ = service->extensions()->GetByID(page_url.host()); | 94 extension_ = service->extensions()->GetByID(page_url.host()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void Init() { | 97 void Init() { |
| 98 if (extension_) { | 98 if (extension_) { |
| 99 ExtensionResource icon_resource = | 99 ExtensionResource icon_resource = |
| 100 extension_->GetIconResource(ExtensionIconSet::EXTENSION_ICON_BITTY, | 100 extension_->GetIconResource(extension_misc::EXTENSION_ICON_BITTY, |
| 101 ExtensionIconSet::MATCH_EXACTLY); | 101 ExtensionIconSet::MATCH_EXACTLY); |
| 102 | 102 |
| 103 tracker_.LoadImage(extension_, icon_resource, | 103 tracker_.LoadImage(extension_, icon_resource, |
| 104 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize), | 104 gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize), |
| 105 ImageLoadingTracker::DONT_CACHE); | 105 ImageLoadingTracker::DONT_CACHE); |
| 106 } else { | 106 } else { |
| 107 ForwardResult(NULL); | 107 ForwardResult(NULL); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 // static | 423 // static |
| 424 void ExtensionWebUI::GetFaviconForURL(Profile* profile, | 424 void ExtensionWebUI::GetFaviconForURL(Profile* profile, |
| 425 FaviconService::GetFaviconRequest* request, const GURL& page_url) { | 425 FaviconService::GetFaviconRequest* request, const GURL& page_url) { |
| 426 // tracker deletes itself when done. | 426 // tracker deletes itself when done. |
| 427 ExtensionWebUIImageLoadingTracker* tracker = | 427 ExtensionWebUIImageLoadingTracker* tracker = |
| 428 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); | 428 new ExtensionWebUIImageLoadingTracker(profile, request, page_url); |
| 429 tracker->Init(); | 429 tracker->Init(); |
| 430 } | 430 } |
| OLD | NEW |