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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 std::string url_pattern = iter->primary_pattern.ToString(); | 282 std::string url_pattern = iter->primary_pattern.ToString(); |
283 base::string16 name = base::UTF8ToUTF16(url_pattern); | 283 base::string16 name = base::UTF8ToUTF16(url_pattern); |
284 GURL url(url_pattern); | 284 GURL url(url_pattern); |
285 NotifierId notifier_id(url); | 285 NotifierId notifier_id(url); |
286 notifiers->push_back(new Notifier( | 286 notifiers->push_back(new Notifier( |
287 notifier_id, | 287 notifier_id, |
288 name, | 288 name, |
289 notification_service->IsNotifierEnabled(notifier_id))); | 289 notification_service->IsNotifierEnabled(notifier_id))); |
290 patterns_[name] = iter->primary_pattern; | 290 patterns_[name] = iter->primary_pattern; |
291 FaviconService::FaviconForURLParams favicon_params( | 291 FaviconService::FaviconForPageURLParams favicon_params( |
292 url, | 292 url, |
293 favicon_base::FAVICON | favicon_base::TOUCH_ICON, | 293 favicon_base::FAVICON | favicon_base::TOUCH_ICON, |
294 message_center::kSettingsIconSize); | 294 message_center::kSettingsIconSize); |
295 // Note that favicon service obtains the favicon from history. This means | 295 // Note that favicon service obtains the favicon from history. This means |
296 // that it will fail to obtain the image if there are no history data for | 296 // that it will fail to obtain the image if there are no history data for |
297 // that URL. | 297 // that URL. |
298 favicon_service->GetFaviconImageForURL( | 298 favicon_service->GetFaviconImageForPageURL( |
299 favicon_params, | 299 favicon_params, |
300 base::Bind(&MessageCenterSettingsController::OnFaviconLoaded, | 300 base::Bind(&MessageCenterSettingsController::OnFaviconLoaded, |
301 base::Unretained(this), url), | 301 base::Unretained(this), |
| 302 url), |
302 favicon_tracker_.get()); | 303 favicon_tracker_.get()); |
303 } | 304 } |
304 | 305 |
305 // Screenshot notification feature is only for ChromeOS. See crbug.com/238358 | 306 // Screenshot notification feature is only for ChromeOS. See crbug.com/238358 |
306 #if defined(OS_CHROMEOS) | 307 #if defined(OS_CHROMEOS) |
307 const base::string16 screenshot_name = | 308 const base::string16 screenshot_name = |
308 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME); | 309 l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_SCREENSHOT_NAME); |
309 NotifierId screenshot_notifier_id( | 310 NotifierId screenshot_notifier_id( |
310 NotifierId::SYSTEM_COMPONENT, ash::system_notifier::kNotifierScreenshot); | 311 NotifierId::SYSTEM_COMPONENT, ash::system_notifier::kNotifierScreenshot); |
311 Notifier* const screenshot_notifier = new Notifier( | 312 Notifier* const screenshot_notifier = new Notifier( |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 // creating a primary profile, and causes an infinite loop. | 546 // creating a primary profile, and causes an infinite loop. |
546 // Thus, it would be better to delay creating group for guest login. | 547 // Thus, it would be better to delay creating group for guest login. |
547 base::MessageLoopProxy::current()->PostTask( | 548 base::MessageLoopProxy::current()->PostTask( |
548 FROM_HERE, | 549 FROM_HERE, |
549 base::Bind( | 550 base::Bind( |
550 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, | 551 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, |
551 weak_factory_.GetWeakPtr())); | 552 weak_factory_.GetWeakPtr())); |
552 } | 553 } |
553 #endif | 554 #endif |
554 } | 555 } |
OLD | NEW |