Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: ui/message_center/cocoa/settings_controller.mm

Issue 20066003: Update notification settings to allow for multiprofile situations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And remove unneeded include. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 namespace message_center { 104 namespace message_center {
105 105
106 NotifierSettingsObserverMac::~NotifierSettingsObserverMac() {} 106 NotifierSettingsObserverMac::~NotifierSettingsObserverMac() {}
107 107
108 void NotifierSettingsObserverMac::UpdateIconImage(const NotifierId& notifier_id, 108 void NotifierSettingsObserverMac::UpdateIconImage(const NotifierId& notifier_id,
109 const gfx::Image& icon) { 109 const gfx::Image& icon) {
110 [settings_controller_ setIcon:icon.AsNSImage() forNotifierId:notifier_id]; 110 [settings_controller_ setIcon:icon.AsNSImage() forNotifierId:notifier_id];
111 } 111 }
112 112
113 void NotifierSettingsObserverMac::NotifierGroupChanged() {}
114
113 } // namespace message_center 115 } // namespace message_center
114 116
115 @implementation MCSettingsController 117 @implementation MCSettingsController
116 118
117 - (id)initWithProvider:(message_center::NotifierSettingsProvider*)provider { 119 - (id)initWithProvider:(message_center::NotifierSettingsProvider*)provider {
118 if ((self = [super initWithNibName:nil bundle:nil])) { 120 if ((self = [super initWithNibName:nil bundle:nil])) {
119 observer_.reset(new message_center::NotifierSettingsObserverMac(self)); 121 observer_.reset(new message_center::NotifierSettingsObserverMac(self));
120 provider_ = provider; 122 provider_ = provider;
121 provider_->AddObserver(observer_.get()); 123 provider_->AddObserver(observer_.get());
122 } 124 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 299
298 - (NSButton*)buttonForNotifierAtIndex:(size_t)index { 300 - (NSButton*)buttonForNotifierAtIndex:(size_t)index {
299 NSArray* subviews = [[scrollView_ documentView] subviews]; 301 NSArray* subviews = [[scrollView_ documentView] subviews];
300 // The checkboxes are in bottom-top order, the checkbox for notifiers_[0] is 302 // The checkboxes are in bottom-top order, the checkbox for notifiers_[0] is
301 // last. 303 // last.
302 NSView* view = [subviews objectAtIndex:notifiers_.size() - 1 - index]; 304 NSView* view = [subviews objectAtIndex:notifiers_.size() - 1 - index];
303 return base::mac::ObjCCastStrict<NSButton>(view); 305 return base::mac::ObjCCastStrict<NSButton>(view);
304 } 306 }
305 307
306 @end 308 @end
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/settings_controller.h ('k') | ui/message_center/fake_notifier_settings_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698