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 #include "ui/message_center/views/toast_contents_view.h" | 5 #include "ui/message_center/views/toast_contents_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 if (collection_) | 300 if (collection_) |
301 collection_->RemoveNotification(notification_id, by_user); | 301 collection_->RemoveNotification(notification_id, by_user); |
302 } | 302 } |
303 | 303 |
304 scoped_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( | 304 scoped_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( |
305 const NotifierId& notifier_id, | 305 const NotifierId& notifier_id, |
306 const base::string16& display_source) { | 306 const base::string16& display_source) { |
307 // Should not reach, the context menu should be handled in | 307 // Should not reach, the context menu should be handled in |
308 // MessagePopupCollection. | 308 // MessagePopupCollection. |
309 NOTREACHED(); | 309 NOTREACHED(); |
310 return scoped_ptr<ui::MenuModel>(); | 310 return nullptr; |
311 } | 311 } |
312 | 312 |
313 bool ToastContentsView::HasClickedListener( | 313 bool ToastContentsView::HasClickedListener( |
314 const std::string& notification_id) { | 314 const std::string& notification_id) { |
315 if (!collection_) | 315 if (!collection_) |
316 return false; | 316 return false; |
317 return collection_->HasClickedListener(notification_id); | 317 return collection_->HasClickedListener(notification_id); |
318 } | 318 } |
319 | 319 |
320 void ToastContentsView::ClickOnNotificationButton( | 320 void ToastContentsView::ClickOnNotificationButton( |
(...skipping 25 matching lines...) Expand all Loading... |
346 } | 346 } |
347 | 347 |
348 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 348 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
349 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 349 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
350 bounds.y(), | 350 bounds.y(), |
351 kClosedToastWidth, | 351 kClosedToastWidth, |
352 bounds.height()); | 352 bounds.height()); |
353 } | 353 } |
354 | 354 |
355 } // namespace message_center | 355 } // namespace message_center |
OLD | NEW |