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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 const std::string& extension_id = notifier_id.id; | 395 const std::string& extension_id = notifier_id.id; |
396 | 396 |
397 if (notifier_groups_.size() < current_notifier_group_) | 397 if (notifier_groups_.size() < current_notifier_group_) |
398 return; | 398 return; |
399 Profile* profile = notifier_groups_[current_notifier_group_]->profile(); | 399 Profile* profile = notifier_groups_[current_notifier_group_]->profile(); |
400 | 400 |
401 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); | 401 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); |
402 scoped_ptr<base::ListValue> args(new base::ListValue()); | 402 scoped_ptr<base::ListValue> args(new base::ListValue()); |
403 | 403 |
404 scoped_ptr<extensions::Event> event(new extensions::Event( | 404 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 405 extensions::events::UNKNOWN, |
405 extensions::api::notifications::OnShowSettings::kEventName, args.Pass())); | 406 extensions::api::notifications::OnShowSettings::kEventName, args.Pass())); |
406 event_router->DispatchEventToExtension(extension_id, event.Pass()); | 407 event_router->DispatchEventToExtension(extension_id, event.Pass()); |
407 } | 408 } |
408 | 409 |
409 void MessageCenterSettingsController::OnFaviconLoaded( | 410 void MessageCenterSettingsController::OnFaviconLoaded( |
410 const GURL& url, | 411 const GURL& url, |
411 const favicon_base::FaviconImageResult& favicon_result) { | 412 const favicon_base::FaviconImageResult& favicon_result) { |
412 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, | 413 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, |
413 observers_, | 414 observers_, |
414 UpdateIconImage(NotifierId(url), favicon_result.image)); | 415 UpdateIconImage(NotifierId(url), favicon_result.image)); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 weak_factory_.GetWeakPtr())); | 548 weak_factory_.GetWeakPtr())); |
548 } | 549 } |
549 #endif | 550 #endif |
550 | 551 |
551 if (notify) { | 552 if (notify) { |
552 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, | 553 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver, |
553 observers_, | 554 observers_, |
554 NotifierGroupChanged()); | 555 NotifierGroupChanged()); |
555 } | 556 } |
556 } | 557 } |
OLD | NEW |