OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/desktop_popup_alignment_delegate.h" | 5 #include "ui/message_center/views/desktop_popup_alignment_delegate.h" |
6 | 6 |
7 #include "ui/display/display.h" | 7 #include "ui/display/display.h" |
8 #include "ui/display/screen.h" | 8 #include "ui/display/screen.h" |
9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
10 #include "ui/message_center/message_center_style.h" | 10 #include "ui/message_center/message_center_style.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // the taskbar is on the top or bottom. | 76 // the taskbar is on the top or bottom. |
77 // Since on some platforms like Ubuntu Unity there's also a launcher along | 77 // Since on some platforms like Ubuntu Unity there's also a launcher along |
78 // with a taskbar (panel), we need to check that there is really nothing at | 78 // with a taskbar (panel), we need to check that there is really nothing at |
79 // the top before concluding that the taskbar is at the left. | 79 // the top before concluding that the taskbar is at the left. |
80 alignment_ |= (work_area_.x() > display.bounds().x() && | 80 alignment_ |= (work_area_.x() > display.bounds().x() && |
81 work_area_.y() == display.bounds().y()) | 81 work_area_.y() == display.bounds().y()) |
82 ? POPUP_ALIGNMENT_LEFT | 82 ? POPUP_ALIGNMENT_LEFT |
83 : POPUP_ALIGNMENT_RIGHT; | 83 : POPUP_ALIGNMENT_RIGHT; |
84 } | 84 } |
85 | 85 |
| 86 void DesktopPopupAlignmentDelegate::ConfigureWidgetInitParamsForContainer( |
| 87 views::Widget* widget, |
| 88 views::Widget::InitParams* init_params) { |
| 89 // Do nothing, which will use the default container. |
| 90 } |
| 91 |
86 void DesktopPopupAlignmentDelegate::OnDisplayAdded( | 92 void DesktopPopupAlignmentDelegate::OnDisplayAdded( |
87 const display::Display& new_display) {} | 93 const display::Display& new_display) {} |
88 | 94 |
89 void DesktopPopupAlignmentDelegate::OnDisplayRemoved( | 95 void DesktopPopupAlignmentDelegate::OnDisplayRemoved( |
90 const display::Display& old_display) {} | 96 const display::Display& old_display) {} |
91 | 97 |
92 void DesktopPopupAlignmentDelegate::OnDisplayMetricsChanged( | 98 void DesktopPopupAlignmentDelegate::OnDisplayMetricsChanged( |
93 const display::Display& display, | 99 const display::Display& display, |
94 uint32_t metrics) { | 100 uint32_t metrics) { |
95 if (display.id() == display_id_) { | 101 if (display.id() == display_id_) { |
96 RecomputeAlignment(display); | 102 RecomputeAlignment(display); |
97 DoUpdateIfPossible(); | 103 DoUpdateIfPossible(); |
98 } | 104 } |
99 } | 105 } |
100 | 106 |
101 } // namespace message_center | 107 } // namespace message_center |
OLD | NEW |