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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (Profile::FromBrowserContext(web_contents->GetBrowserContext()) != profile) | 71 if (Profile::FromBrowserContext(web_contents->GetBrowserContext()) != profile) |
72 return; | 72 return; |
73 | 73 |
74 GURL url = web_contents->GetURL(); | 74 GURL url = web_contents->GetURL(); |
75 if (!url.SchemeIs(chrome::kChromeUIScheme) || url.host() != page) | 75 if (!url.SchemeIs(chrome::kChromeUIScheme) || url.host() != page) |
76 return; | 76 return; |
77 | 77 |
78 // Don't use Reload() since |url| isn't the same as the internal URL that | 78 // Don't use Reload() since |url| isn't the same as the internal URL that |
79 // NavigationController has. | 79 // NavigationController has. |
80 web_contents->GetController().LoadURL( | 80 web_contents->GetController().LoadURL( |
81 url, content::Referrer(url, WebKit::WebReferrerPolicyDefault), | 81 url, content::Referrer(url, blink::WebReferrerPolicyDefault), |
82 content::PAGE_TRANSITION_RELOAD, std::string()); | 82 content::PAGE_TRANSITION_RELOAD, std::string()); |
83 } | 83 } |
84 | 84 |
85 // Run favicon callbck with image result. If no favicon was available then | 85 // Run favicon callbck with image result. If no favicon was available then |
86 // |image| will be empty. | 86 // |image| will be empty. |
87 void RunFaviconCallbackAsync( | 87 void RunFaviconCallbackAsync( |
88 const FaviconService::FaviconResultsCallback& callback, | 88 const FaviconService::FaviconResultsCallback& callback, |
89 const gfx::Image& image) { | 89 const gfx::Image& image) { |
90 std::vector<chrome::FaviconBitmapResult>* favicon_bitmap_results = | 90 std::vector<chrome::FaviconBitmapResult>* favicon_bitmap_results = |
91 new std::vector<chrome::FaviconBitmapResult>(); | 91 new std::vector<chrome::FaviconBitmapResult>(); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, | 418 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, |
419 gfx::Size(pixel_size, pixel_size), | 419 gfx::Size(pixel_size, pixel_size), |
420 scale_factors[i])); | 420 scale_factors[i])); |
421 } | 421 } |
422 | 422 |
423 // LoadImagesAsync actually can run callback synchronously. We want to force | 423 // LoadImagesAsync actually can run callback synchronously. We want to force |
424 // async. | 424 // async. |
425 extensions::ImageLoader::Get(profile)->LoadImagesAsync( | 425 extensions::ImageLoader::Get(profile)->LoadImagesAsync( |
426 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); | 426 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); |
427 } | 427 } |
OLD | NEW |