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

Side by Side Diff: ui/message_center/views/toast_contents_view.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/views/toast_contents_view.h ('k') | ui/mojo/init/ui_init.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/views/toast_contents_view.h" 5 #include "ui/message_center/views/toast_contents_view.h"
6 6
7 #include <memory>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 #include "build/build_config.h" 13 #include "build/build_config.h"
13 #include "ui/accessibility/ax_view_state.h" 14 #include "ui/accessibility/ax_view_state.h"
14 #include "ui/gfx/animation/animation_delegate.h" 15 #include "ui/gfx/animation/animation_delegate.h"
15 #include "ui/gfx/animation/slide_animation.h" 16 #include "ui/gfx/animation/slide_animation.h"
16 #include "ui/gfx/display.h" 17 #include "ui/gfx/display.h"
17 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
18 #include "ui/message_center/message_center_style.h" 19 #include "ui/message_center/message_center_style.h"
19 #include "ui/message_center/notification.h" 20 #include "ui/message_center/notification.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 collection_->ClickOnSettingsButton(notification_id); 307 collection_->ClickOnSettingsButton(notification_id);
307 } 308 }
308 309
309 void ToastContentsView::RemoveNotification( 310 void ToastContentsView::RemoveNotification(
310 const std::string& notification_id, 311 const std::string& notification_id,
311 bool by_user) { 312 bool by_user) {
312 if (collection_) 313 if (collection_)
313 collection_->RemoveNotification(notification_id, by_user); 314 collection_->RemoveNotification(notification_id, by_user);
314 } 315 }
315 316
316 scoped_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( 317 std::unique_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel(
317 const NotifierId& notifier_id, 318 const NotifierId& notifier_id,
318 const base::string16& display_source) { 319 const base::string16& display_source) {
319 // Should not reach, the context menu should be handled in 320 // Should not reach, the context menu should be handled in
320 // MessagePopupCollection. 321 // MessagePopupCollection.
321 NOTREACHED(); 322 NOTREACHED();
322 return nullptr; 323 return nullptr;
323 } 324 }
324 325
325 bool ToastContentsView::HasClickedListener( 326 bool ToastContentsView::HasClickedListener(
326 const std::string& notification_id) { 327 const std::string& notification_id) {
327 if (!collection_) 328 if (!collection_)
328 return false; 329 return false;
(...skipping 29 matching lines...) Expand all
358 } 359 }
359 360
360 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { 361 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) {
361 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, 362 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth,
362 bounds.y(), 363 bounds.y(),
363 kClosedToastWidth, 364 kClosedToastWidth,
364 bounds.height()); 365 bounds.height());
365 } 366 }
366 367
367 } // namespace message_center 368 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/toast_contents_view.h ('k') | ui/mojo/init/ui_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698