| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void ToastContentsView::AnimationEnded(const gfx::Animation* animation) { | 231 void ToastContentsView::AnimationEnded(const gfx::Animation* animation) { |
| 232 OnBoundsAnimationEndedOrCancelled(animation); | 232 OnBoundsAnimationEndedOrCancelled(animation); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void ToastContentsView::AnimationCanceled( | 235 void ToastContentsView::AnimationCanceled( |
| 236 const gfx::Animation* animation) { | 236 const gfx::Animation* animation) { |
| 237 OnBoundsAnimationEndedOrCancelled(animation); | 237 OnBoundsAnimationEndedOrCancelled(animation); |
| 238 } | 238 } |
| 239 | 239 |
| 240 // views::WidgetDelegate | 240 // views::WidgetDelegate |
| 241 views::View* ToastContentsView::GetContentsView() { | |
| 242 return this; | |
| 243 } | |
| 244 | |
| 245 void ToastContentsView::WindowClosing() { | 241 void ToastContentsView::WindowClosing() { |
| 246 if (!is_closing_ && collection_.get()) | 242 if (!is_closing_ && collection_.get()) |
| 247 collection_->ForgetToast(this); | 243 collection_->ForgetToast(this); |
| 248 } | 244 } |
| 249 | 245 |
| 250 void ToastContentsView::OnDisplayChanged() { | 246 void ToastContentsView::OnDisplayChanged() { |
| 251 views::Widget* widget = GetWidget(); | 247 views::Widget* widget = GetWidget(); |
| 252 if (!widget) | 248 if (!widget) |
| 253 return; | 249 return; |
| 254 | 250 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 379 } |
| 384 | 380 |
| 385 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 381 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
| 386 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 382 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
| 387 bounds.y(), | 383 bounds.y(), |
| 388 kClosedToastWidth, | 384 kClosedToastWidth, |
| 389 bounds.height()); | 385 bounds.height()); |
| 390 } | 386 } |
| 391 | 387 |
| 392 } // namespace message_center | 388 } // namespace message_center |
| OLD | NEW |