| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (collection_) | 322 if (collection_) |
| 323 collection_->ClickOnNotificationButton(notification_id, button_index); | 323 collection_->ClickOnNotificationButton(notification_id, button_index); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void ToastContentsView::ExpandNotification( | 326 void ToastContentsView::ExpandNotification( |
| 327 const std::string& notification_id) { | 327 const std::string& notification_id) { |
| 328 if (collection_) | 328 if (collection_) |
| 329 collection_->ExpandNotification(notification_id); | 329 collection_->ExpandNotification(notification_id); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void ToastContentsView::GroupBodyClicked( | |
| 333 const std::string& last_notification_id) { | |
| 334 // No group views in popup collection. | |
| 335 NOTREACHED(); | |
| 336 } | |
| 337 | |
| 338 // When clicked on the "N more" button, perform some reasonable action. | |
| 339 // TODO(dimich): find out what the reasonable action could be. | |
| 340 void ToastContentsView::ExpandGroup(const NotifierId& notifier_id) { | |
| 341 // No group views in popup collection. | |
| 342 NOTREACHED(); | |
| 343 } | |
| 344 | |
| 345 void ToastContentsView::RemoveGroup(const NotifierId& notifier_id) { | |
| 346 // No group views in popup collection. | |
| 347 NOTREACHED(); | |
| 348 } | |
| 349 | |
| 350 void ToastContentsView::CreateWidget(gfx::NativeView parent) { | 332 void ToastContentsView::CreateWidget(gfx::NativeView parent) { |
| 351 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 333 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 352 params.keep_on_top = true; | 334 params.keep_on_top = true; |
| 353 if (parent) | 335 if (parent) |
| 354 params.parent = parent; | 336 params.parent = parent; |
| 355 else | 337 else |
| 356 params.top_level = true; | 338 params.top_level = true; |
| 357 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 339 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 358 params.delegate = this; | 340 params.delegate = this; |
| 359 views::Widget* widget = new views::Widget(); | 341 views::Widget* widget = new views::Widget(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 371 } | 353 } |
| 372 | 354 |
| 373 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 355 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
| 374 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 356 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
| 375 bounds.y(), | 357 bounds.y(), |
| 376 kClosedToastWidth, | 358 kClosedToastWidth, |
| 377 bounds.height()); | 359 bounds.height()); |
| 378 } | 360 } |
| 379 | 361 |
| 380 } // namespace message_center | 362 } // namespace message_center |
| OLD | NEW |