| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 collection_->ClickOnNotification(notification_id); | 293 collection_->ClickOnNotification(notification_id); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void ToastContentsView::RemoveNotification( | 296 void ToastContentsView::RemoveNotification( |
| 297 const std::string& notification_id, | 297 const std::string& notification_id, |
| 298 bool by_user) { | 298 bool by_user) { |
| 299 if (collection_) | 299 if (collection_) |
| 300 collection_->RemoveNotification(notification_id, by_user); | 300 collection_->RemoveNotification(notification_id, by_user); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void ToastContentsView::DisableNotificationsFromThisSource( | 303 scoped_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( |
| 304 const NotifierId& notifier_id) { | 304 const NotifierId& notifier_id, |
| 305 if (collection_) | 305 const base::string16& display_source) { |
| 306 collection_->DisableNotificationsFromThisSource(notifier_id); | 306 // Should not reach, the context menu should be handled in |
| 307 } | 307 // MessagePopupCollection. |
| 308 | 308 NOTREACHED(); |
| 309 void ToastContentsView::ShowNotifierSettingsBubble() { | 309 return scoped_ptr<ui::MenuModel>(); |
| 310 if (collection_) | |
| 311 collection_->ShowNotifierSettingsBubble(); | |
| 312 } | 310 } |
| 313 | 311 |
| 314 bool ToastContentsView::HasClickedListener( | 312 bool ToastContentsView::HasClickedListener( |
| 315 const std::string& notification_id) { | 313 const std::string& notification_id) { |
| 316 if (!collection_) | 314 if (!collection_) |
| 317 return false; | 315 return false; |
| 318 return collection_->HasClickedListener(notification_id); | 316 return collection_->HasClickedListener(notification_id); |
| 319 } | 317 } |
| 320 | 318 |
| 321 void ToastContentsView::ClickOnNotificationButton( | 319 void ToastContentsView::ClickOnNotificationButton( |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 371 } |
| 374 | 372 |
| 375 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 373 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
| 376 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 374 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
| 377 bounds.y(), | 375 bounds.y(), |
| 378 kClosedToastWidth, | 376 kClosedToastWidth, |
| 379 bounds.height()); | 377 bounds.height()); |
| 380 } | 378 } |
| 381 | 379 |
| 382 } // namespace message_center | 380 } // namespace message_center |
| OLD | NEW |