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

Side by Side Diff: ui/message_center/message_center_tray.cc

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 #include "ui/message_center/message_center_tray.h" 5 #include "ui/message_center/message_center_tray.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 std::unique_ptr<ui::MenuModel> MessageCenterTray::CreateNotificationMenuModel( 195 std::unique_ptr<ui::MenuModel> MessageCenterTray::CreateNotificationMenuModel(
196 const NotifierId& notifier_id, 196 const NotifierId& notifier_id,
197 const base::string16& display_source) { 197 const base::string16& display_source) {
198 #if !defined(OS_CHROMEOS) 198 #if !defined(OS_CHROMEOS)
199 // Only web pages are configurable on non-chromeos platforms. 199 // Only web pages are configurable on non-chromeos platforms.
200 if (notifier_id.type != NotifierId::WEB_PAGE) { 200 if (notifier_id.type != NotifierId::WEB_PAGE) {
201 return nullptr; 201 return nullptr;
202 } 202 }
203 #endif 203 #endif
204 204
205 return base::WrapUnique( 205 return base::MakeUnique<NotificationMenuModel>(this, notifier_id,
206 new NotificationMenuModel(this, notifier_id, display_source)); 206 display_source);
207 } 207 }
208 208
209 void MessageCenterTray::OnNotificationAdded( 209 void MessageCenterTray::OnNotificationAdded(
210 const std::string& notification_id) { 210 const std::string& notification_id) {
211 OnMessageCenterChanged(); 211 OnMessageCenterChanged();
212 } 212 }
213 213
214 void MessageCenterTray::OnNotificationRemoved( 214 void MessageCenterTray::OnNotificationRemoved(
215 const std::string& notification_id, 215 const std::string& notification_id,
216 bool by_user) { 216 bool by_user) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 ShowPopupBubble(); 259 ShowPopupBubble();
260 260
261 NotifyMessageCenterTrayChanged(); 261 NotifyMessageCenterTrayChanged();
262 } 262 }
263 263
264 void MessageCenterTray::NotifyMessageCenterTrayChanged() { 264 void MessageCenterTray::NotifyMessageCenterTrayChanged() {
265 delegate_->OnMessageCenterTrayChanged(); 265 delegate_->OnMessageCenterTrayChanged();
266 } 266 }
267 267
268 } // namespace message_center 268 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_center_impl_unittest.cc ('k') | ui/message_center/views/message_popup_collection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698