| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 if (collection_) | 320 if (collection_) |
| 321 collection_->ClickOnNotification(notification_id); | 321 collection_->ClickOnNotification(notification_id); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void ToastContentsView::ClickOnSettingsButton( | 324 void ToastContentsView::ClickOnSettingsButton( |
| 325 const std::string& notification_id) { | 325 const std::string& notification_id) { |
| 326 if (collection_) | 326 if (collection_) |
| 327 collection_->ClickOnSettingsButton(notification_id); | 327 collection_->ClickOnSettingsButton(notification_id); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void ToastContentsView::UpdateNotificationSize( |
| 331 const std::string& notification_id) { |
| 332 if (collection_) |
| 333 collection_->UpdateNotificationSize(notification_id); |
| 334 } |
| 335 |
| 330 void ToastContentsView::RemoveNotification( | 336 void ToastContentsView::RemoveNotification( |
| 331 const std::string& notification_id, | 337 const std::string& notification_id, |
| 332 bool by_user) { | 338 bool by_user) { |
| 333 if (collection_) | 339 if (collection_) |
| 334 collection_->RemoveNotification(notification_id, by_user); | 340 collection_->RemoveNotification(notification_id, by_user); |
| 335 } | 341 } |
| 336 | 342 |
| 337 std::unique_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( | 343 std::unique_ptr<ui::MenuModel> ToastContentsView::CreateMenuModel( |
| 338 const NotifierId& notifier_id, | 344 const NotifierId& notifier_id, |
| 339 const base::string16& display_source) { | 345 const base::string16& display_source) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 389 } |
| 384 | 390 |
| 385 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 391 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
| 386 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 392 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
| 387 bounds.y(), | 393 bounds.y(), |
| 388 kClosedToastWidth, | 394 kClosedToastWidth, |
| 389 bounds.height()); | 395 bounds.height()); |
| 390 } | 396 } |
| 391 | 397 |
| 392 } // namespace message_center | 398 } // namespace message_center |
| OLD | NEW |