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" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/prefs/scoped_user_pref_update.h" | 12 #include "base/prefs/scoped_user_pref_update.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/thread_task_runner_handle.h" |
15 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" | 16 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage
r_private_api.h" |
16 #include "chrome/browser/extensions/extension_tab_util.h" | 17 #include "chrome/browser/extensions/extension_tab_util.h" |
17 #include "chrome/browser/extensions/extension_util.h" | 18 #include "chrome/browser/extensions/extension_util.h" |
18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/extensions/extension_constants.h" | 21 #include "chrome/common/extensions/extension_constants.h" |
21 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
22 #include "components/favicon/core/favicon_service.h" | 23 #include "components/favicon/core/favicon_service.h" |
23 #include "components/favicon_base/favicon_util.h" | 24 #include "components/favicon_base/favicon_util.h" |
24 #include "components/pref_registry/pref_registry_syncable.h" | 25 #include "components/pref_registry/pref_registry_syncable.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 image_rep.pixel_height()); | 109 image_rep.pixel_height()); |
109 // Leave |bitmap_result|'s icon URL as the default of GURL(). | 110 // Leave |bitmap_result|'s icon URL as the default of GURL(). |
110 bitmap_result.icon_type = favicon_base::FAVICON; | 111 bitmap_result.icon_type = favicon_base::FAVICON; |
111 | 112 |
112 favicon_bitmap_results->push_back(bitmap_result); | 113 favicon_bitmap_results->push_back(bitmap_result); |
113 } else { | 114 } else { |
114 NOTREACHED() << "Could not encode extension favicon"; | 115 NOTREACHED() << "Could not encode extension favicon"; |
115 } | 116 } |
116 } | 117 } |
117 | 118 |
118 base::MessageLoopProxy::current()->PostTask( | 119 base::ThreadTaskRunnerHandle::Get()->PostTask( |
119 FROM_HERE, | 120 FROM_HERE, |
120 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner, | 121 base::Bind(&favicon::FaviconService::FaviconResultsCallbackRunner, |
121 callback, base::Owned(favicon_bitmap_results))); | 122 callback, base::Owned(favicon_bitmap_results))); |
122 } | 123 } |
123 | 124 |
124 bool ValidateOverrideURL(const base::Value* override_url_value, | 125 bool ValidateOverrideURL(const base::Value* override_url_value, |
125 const GURL& source_url, | 126 const GURL& source_url, |
126 const extensions::ExtensionSet& extensions, | 127 const extensions::ExtensionSet& extensions, |
127 GURL* override_url, | 128 GURL* override_url, |
128 const Extension** extension) { | 129 const Extension** extension) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, | 431 extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE, |
431 gfx::Size(pixel_size, pixel_size), | 432 gfx::Size(pixel_size, pixel_size), |
432 resource_scale_factor)); | 433 resource_scale_factor)); |
433 } | 434 } |
434 | 435 |
435 // LoadImagesAsync actually can run callback synchronously. We want to force | 436 // LoadImagesAsync actually can run callback synchronously. We want to force |
436 // async. | 437 // async. |
437 extensions::ImageLoader::Get(profile)->LoadImagesAsync( | 438 extensions::ImageLoader::Get(profile)->LoadImagesAsync( |
438 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); | 439 extension, info_list, base::Bind(&RunFaviconCallbackAsync, callback)); |
439 } | 440 } |
OLD | NEW |