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/message_popup_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "ui/accessibility/ax_enums.h" | 16 #include "ui/accessibility/ax_enums.h" |
17 #include "ui/gfx/animation/animation_delegate.h" | 17 #include "ui/gfx/animation/animation_delegate.h" |
18 #include "ui/gfx/animation/slide_animation.h" | 18 #include "ui/gfx/animation/slide_animation.h" |
19 #include "ui/gfx/screen.h" | |
20 #include "ui/message_center/message_center.h" | 19 #include "ui/message_center/message_center.h" |
21 #include "ui/message_center/message_center_style.h" | 20 #include "ui/message_center/message_center_style.h" |
22 #include "ui/message_center/message_center_tray.h" | 21 #include "ui/message_center/message_center_tray.h" |
23 #include "ui/message_center/notification.h" | 22 #include "ui/message_center/notification.h" |
24 #include "ui/message_center/notification_list.h" | 23 #include "ui/message_center/notification_list.h" |
25 #include "ui/message_center/views/message_view_context_menu_controller.h" | 24 #include "ui/message_center/views/message_view_context_menu_controller.h" |
26 #include "ui/message_center/views/notification_view.h" | 25 #include "ui/message_center/views/notification_view.h" |
27 #include "ui/message_center/views/popup_alignment_delegate.h" | 26 #include "ui/message_center/views/popup_alignment_delegate.h" |
28 #include "ui/message_center/views/toast_contents_view.h" | 27 #include "ui/message_center/views/toast_contents_view.h" |
29 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 return; | 498 return; |
500 | 499 |
501 // Test support. Quit the test run loop when no more updates are deferred, | 500 // Test support. Quit the test run loop when no more updates are deferred, |
502 // meaining th echeck for updates did not cause anything to change so no new | 501 // meaining th echeck for updates did not cause anything to change so no new |
503 // transition animations were started. | 502 // transition animations were started. |
504 if (run_loop_for_test_.get()) | 503 if (run_loop_for_test_.get()) |
505 run_loop_for_test_->Quit(); | 504 run_loop_for_test_->Quit(); |
506 } | 505 } |
507 | 506 |
508 void MessagePopupCollection::OnDisplayMetricsChanged( | 507 void MessagePopupCollection::OnDisplayMetricsChanged( |
509 const gfx::Display& display) { | 508 const display::Display& display) { |
510 alignment_delegate_->RecomputeAlignment(display); | 509 alignment_delegate_->RecomputeAlignment(display); |
511 } | 510 } |
512 | 511 |
513 views::Widget* MessagePopupCollection::GetWidgetForTest(const std::string& id) | 512 views::Widget* MessagePopupCollection::GetWidgetForTest(const std::string& id) |
514 const { | 513 const { |
515 for (Toasts::const_iterator iter = toasts_.begin(); iter != toasts_.end(); | 514 for (Toasts::const_iterator iter = toasts_.begin(); iter != toasts_.end(); |
516 ++iter) { | 515 ++iter) { |
517 if ((*iter)->id() == id) | 516 if ((*iter)->id() == id) |
518 return (*iter)->GetWidget(); | 517 return (*iter)->GetWidget(); |
519 } | 518 } |
(...skipping 18 matching lines...) Expand all Loading... |
538 views::Widget* widget = (*iter)->GetWidget(); | 537 views::Widget* widget = (*iter)->GetWidget(); |
539 if (widget) | 538 if (widget) |
540 return widget->GetWindowBoundsInScreen(); | 539 return widget->GetWindowBoundsInScreen(); |
541 break; | 540 break; |
542 } | 541 } |
543 } | 542 } |
544 return gfx::Rect(); | 543 return gfx::Rect(); |
545 } | 544 } |
546 | 545 |
547 } // namespace message_center | 546 } // namespace message_center |
OLD | NEW |