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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 std::string url_pattern = iter->primary_pattern.ToString(); | 265 std::string url_pattern = iter->primary_pattern.ToString(); |
266 base::string16 name = base::UTF8ToUTF16(url_pattern); | 266 base::string16 name = base::UTF8ToUTF16(url_pattern); |
267 GURL url(url_pattern); | 267 GURL url(url_pattern); |
268 NotifierId notifier_id(url); | 268 NotifierId notifier_id(url); |
269 notifiers->push_back(new Notifier( | 269 notifiers->push_back(new Notifier( |
270 notifier_id, | 270 notifier_id, |
271 name, | 271 name, |
272 notification_service->IsNotifierEnabled(notifier_id))); | 272 notification_service->IsNotifierEnabled(notifier_id))); |
273 patterns_[name] = iter->primary_pattern; | 273 patterns_[name] = iter->primary_pattern; |
274 FaviconService::FaviconForPageURLParams favicon_params( | |
275 url, | |
276 favicon_base::FAVICON | favicon_base::TOUCH_ICON, | |
277 message_center::kSettingsIconSize); | |
278 // Note that favicon service obtains the favicon from history. This means | 274 // Note that favicon service obtains the favicon from history. This means |
279 // that it will fail to obtain the image if there are no history data for | 275 // that it will fail to obtain the image if there are no history data for |
280 // that URL. | 276 // that URL. |
281 favicon_service->GetFaviconImageForPageURL( | 277 favicon_service->GetFaviconImageForPageURL( |
282 favicon_params, | 278 url, |
283 base::Bind(&MessageCenterSettingsController::OnFaviconLoaded, | 279 base::Bind(&MessageCenterSettingsController::OnFaviconLoaded, |
284 base::Unretained(this), | 280 base::Unretained(this), |
285 url), | 281 url), |
286 favicon_tracker_.get()); | 282 favicon_tracker_.get()); |
287 } | 283 } |
288 | 284 |
289 // Screenshot notification feature is only for ChromeOS. See crbug.com/238358 | 285 // Screenshot notification feature is only for ChromeOS. See crbug.com/238358 |
290 #if defined(OS_CHROMEOS) | 286 #if defined(OS_CHROMEOS) |
291 const base::string16 screenshot_name = | 287 const base::string16 screenshot_name = |
292 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME); | 288 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 // another creating a primary profile, and causes an infinite loop. | 518 // another creating a primary profile, and causes an infinite loop. |
523 // Thus, it would be better to delay creating group for guest login. | 519 // Thus, it would be better to delay creating group for guest login. |
524 base::MessageLoopProxy::current()->PostTask( | 520 base::MessageLoopProxy::current()->PostTask( |
525 FROM_HERE, | 521 FROM_HERE, |
526 base::Bind( | 522 base::Bind( |
527 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, | 523 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, |
528 weak_factory_.GetWeakPtr())); | 524 weak_factory_.GetWeakPtr())); |
529 } | 525 } |
530 #endif | 526 #endif |
531 } | 527 } |
OLD | NEW |