| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "ui/accessibility/ax_view_state.h" | 14 #include "ui/accessibility/ax_view_state.h" |
| 15 #include "ui/display/screen.h" |
| 15 #include "ui/gfx/animation/animation_delegate.h" | 16 #include "ui/gfx/animation/animation_delegate.h" |
| 16 #include "ui/gfx/animation/slide_animation.h" | 17 #include "ui/gfx/animation/slide_animation.h" |
| 17 #include "ui/gfx/display.h" | |
| 18 #include "ui/gfx/screen.h" | |
| 19 #include "ui/message_center/message_center_style.h" | 18 #include "ui/message_center/message_center_style.h" |
| 20 #include "ui/message_center/notification.h" | 19 #include "ui/message_center/notification.h" |
| 21 #include "ui/message_center/views/message_popup_collection.h" | 20 #include "ui/message_center/views/message_popup_collection.h" |
| 22 #include "ui/message_center/views/message_view.h" | 21 #include "ui/message_center/views/message_view.h" |
| 23 #include "ui/views/background.h" | 22 #include "ui/views/background.h" |
| 24 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 26 #include "ui/views/widget/widget_delegate.h" | 25 #include "ui/views/widget/widget_delegate.h" |
| 27 | 26 |
| 28 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 29 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 28 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 30 #endif | 29 #endif |
| 31 | 30 |
| 32 using gfx::Screen; | 31 using display::Screen; |
| 33 | 32 |
| 34 namespace message_center { | 33 namespace message_center { |
| 35 namespace { | 34 namespace { |
| 36 | 35 |
| 37 // The width of a toast before animated reveal and after closing. | 36 // The width of a toast before animated reveal and after closing. |
| 38 const int kClosedToastWidth = 5; | 37 const int kClosedToastWidth = 5; |
| 39 | 38 |
| 40 // FadeIn/Out look a bit better if they are slightly longer then default slide. | 39 // FadeIn/Out look a bit better if they are slightly longer then default slide. |
| 41 const int kFadeInOutDuration = 200; | 40 const int kFadeInOutDuration = 200; |
| 42 | 41 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 } | 358 } |
| 360 | 359 |
| 361 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { | 360 gfx::Rect ToastContentsView::GetClosedToastBounds(gfx::Rect bounds) { |
| 362 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, | 361 return gfx::Rect(bounds.x() + bounds.width() - kClosedToastWidth, |
| 363 bounds.y(), | 362 bounds.y(), |
| 364 kClosedToastWidth, | 363 kClosedToastWidth, |
| 365 bounds.height()); | 364 bounds.height()); |
| 366 } | 365 } |
| 367 | 366 |
| 368 } // namespace message_center | 367 } // namespace message_center |
| OLD | NEW |