| 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 #import "ui/message_center/cocoa/settings_controller.h" | 5 #import "ui/message_center/cocoa/settings_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 void NotifierSettingsObserverMac::UpdateIconImage(const NotifierId& notifier_id, | 76 void NotifierSettingsObserverMac::UpdateIconImage(const NotifierId& notifier_id, |
| 77 const gfx::Image& icon) { | 77 const gfx::Image& icon) { |
| 78 [settings_controller_ setIcon:icon.AsNSImage() forNotifierId:notifier_id]; | 78 [settings_controller_ setIcon:icon.AsNSImage() forNotifierId:notifier_id]; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void NotifierSettingsObserverMac::NotifierGroupChanged() { | 81 void NotifierSettingsObserverMac::NotifierGroupChanged() { |
| 82 [settings_controller_ updateView]; | 82 [settings_controller_ updateView]; |
| 83 } | 83 } |
| 84 | 84 |
| 85 void NotifierSettingsObserverMac::NotifierEnabledChanged( |
| 86 const NotifierId& notifier_id, bool enabled) {} |
| 87 |
| 85 } // namespace message_center | 88 } // namespace message_center |
| 86 | 89 |
| 87 @implementation MCSettingsController | 90 @implementation MCSettingsController |
| 88 | 91 |
| 89 - (id)initWithProvider:(message_center::NotifierSettingsProvider*)provider | 92 - (id)initWithProvider:(message_center::NotifierSettingsProvider*)provider |
| 90 trayViewController:(MCTrayViewController*)trayViewController { | 93 trayViewController:(MCTrayViewController*)trayViewController { |
| 91 if ((self = [super initWithNibName:nil bundle:nil])) { | 94 if ((self = [super initWithNibName:nil bundle:nil])) { |
| 92 observer_.reset(new message_center::NotifierSettingsObserverMac(self)); | 95 observer_.reset(new message_center::NotifierSettingsObserverMac(self)); |
| 93 provider_ = provider; | 96 provider_ = provider; |
| 94 trayViewController_ = trayViewController; | 97 trayViewController_ = trayViewController; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 NSPopUpButton* button = static_cast<NSPopUpButton*>(sender); | 334 NSPopUpButton* button = static_cast<NSPopUpButton*>(sender); |
| 332 // The first item is a dummy item. | 335 // The first item is a dummy item. |
| 333 provider_->SwitchToNotifierGroup([button indexOfSelectedItem] - 1); | 336 provider_->SwitchToNotifierGroup([button indexOfSelectedItem] - 1); |
| 334 } | 337 } |
| 335 | 338 |
| 336 - (BOOL)notifierHasAdvancedSettings:(const message_center::NotifierId&)id { | 339 - (BOOL)notifierHasAdvancedSettings:(const message_center::NotifierId&)id { |
| 337 return provider_->NotifierHasAdvancedSettings(id); | 340 return provider_->NotifierHasAdvancedSettings(id); |
| 338 } | 341 } |
| 339 | 342 |
| 340 @end | 343 @end |
| OLD | NEW |