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/notification.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/notification.h" 5 #include "ui/message_center/notification.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/message_center/notification_delegate.h" 8 #include "ui/message_center/notification_delegate.h"
9 #include "ui/message_center/notification_types.h" 9 #include "ui/message_center/notification_types.h"
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 optional_fields_.priority = SYSTEM_PRIORITY; 162 optional_fields_.priority = SYSTEM_PRIORITY;
163 optional_fields_.never_timeout = true; 163 optional_fields_.never_timeout = true;
164 } 164 }
165 165
166 bool Notification::UseOriginAsContextMessage() const { 166 bool Notification::UseOriginAsContextMessage() const {
167 return optional_fields_.context_message.empty() && origin_url_.is_valid() && 167 return optional_fields_.context_message.empty() && origin_url_.is_valid() &&
168 origin_url_.SchemeIsHTTPOrHTTPS(); 168 origin_url_.SchemeIsHTTPOrHTTPS();
169 } 169 }
170 170
171 // static 171 // static
172 scoped_ptr<Notification> Notification::CreateSystemNotification( 172 std::unique_ptr<Notification> Notification::CreateSystemNotification(
173 const std::string& notification_id, 173 const std::string& notification_id,
174 const base::string16& title, 174 const base::string16& title,
175 const base::string16& message, 175 const base::string16& message,
176 const gfx::Image& icon, 176 const gfx::Image& icon,
177 const std::string& system_component_id, 177 const std::string& system_component_id,
178 const base::Closure& click_callback) { 178 const base::Closure& click_callback) {
179 scoped_ptr<Notification> notification(new Notification( 179 std::unique_ptr<Notification> notification(new Notification(
180 NOTIFICATION_TYPE_SIMPLE, notification_id, title, message, icon, 180 NOTIFICATION_TYPE_SIMPLE, notification_id, title, message, icon,
181 base::string16() /* display_source */, GURL(), 181 base::string16() /* display_source */, GURL(),
182 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id), 182 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id),
183 RichNotificationData(), 183 RichNotificationData(),
184 new HandleNotificationClickedDelegate(click_callback))); 184 new HandleNotificationClickedDelegate(click_callback)));
185 notification->SetSystemPriority(); 185 notification->SetSystemPriority();
186 return notification; 186 return notification;
187 } 187 }
188 188
189 } // namespace message_center 189 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698