OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/notifications/message_center_settings_controller.h" | 5 #include "chrome/browser/notifications/message_center_settings_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/string_compare.h" | 9 #include "base/i18n/string_compare.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const ExtensionSet* extension_set = extension_service->extensions(); | 81 const ExtensionSet* extension_set = extension_service->extensions(); |
82 // The extension icon size has to be 32x32 at least to load bigger icons if | 82 // The extension icon size has to be 32x32 at least to load bigger icons if |
83 // the icon doesn't exist for the specified size, and in that case it falls | 83 // the icon doesn't exist for the specified size, and in that case it falls |
84 // back to the default icon. The fetched icon will be resized in the settings | 84 // back to the default icon. The fetched icon will be resized in the settings |
85 // dialog. See chrome/browser/extensions/extension_icon_image.cc and | 85 // dialog. See chrome/browser/extensions/extension_icon_image.cc and |
86 // crbug.com/222931 | 86 // crbug.com/222931 |
87 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( | 87 app_icon_loader_.reset(new extensions::AppIconLoaderImpl( |
88 profile, extension_misc::EXTENSION_ICON_SMALL, this)); | 88 profile, extension_misc::EXTENSION_ICON_SMALL, this)); |
89 for (ExtensionSet::const_iterator iter = extension_set->begin(); | 89 for (ExtensionSet::const_iterator iter = extension_set->begin(); |
90 iter != extension_set->end(); ++iter) { | 90 iter != extension_set->end(); ++iter) { |
91 const extensions::Extension* extension = *iter; | 91 const extensions::Extension* extension = iter->get(); |
92 if (!extension->HasAPIPermission( | 92 if (!extension->HasAPIPermission( |
93 extensions::APIPermission::kNotification)) { | 93 extensions::APIPermission::kNotification)) { |
94 continue; | 94 continue; |
95 } | 95 } |
96 | 96 |
97 notifiers->push_back(new message_center::Notifier( | 97 notifiers->push_back(new message_center::Notifier( |
98 extension->id(), | 98 extension->id(), |
99 UTF8ToUTF16(extension->name()), | 99 UTF8ToUTF16(extension->name()), |
100 notification_service->IsExtensionEnabled(extension->id()))); | 100 notification_service->IsExtensionEnabled(extension->id()))); |
101 app_icon_loader_->FetchImage(extension->id()); | 101 app_icon_loader_->FetchImage(extension->id()); |
102 } | 102 } |
103 if (comparator) | 103 if (comparator) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 delegate_->UpdateFavicon(url, favicon_result.image); | 226 delegate_->UpdateFavicon(url, favicon_result.image); |
227 } | 227 } |
228 | 228 |
229 | 229 |
230 void MessageCenterSettingsController::SetAppImage(const std::string& id, | 230 void MessageCenterSettingsController::SetAppImage(const std::string& id, |
231 const gfx::ImageSkia& image) { | 231 const gfx::ImageSkia& image) { |
232 if (!delegate_) | 232 if (!delegate_) |
233 return; | 233 return; |
234 delegate_->UpdateIconImage(id, gfx::Image(image) ); | 234 delegate_->UpdateIconImage(id, gfx::Image(image) ); |
235 } | 235 } |
OLD | NEW |