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 "ash/system/web_notification/ash_popup_alignment_delegate.h" | 5 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
6 | 6 |
| 7 #include "ash/common/shelf/shelf_constants.h" |
| 8 #include "ash/common/shelf/shelf_types.h" |
7 #include "ash/common/wm_lookup.h" | 9 #include "ash/common/wm_lookup.h" |
8 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
9 #include "ash/display/window_tree_host_manager.h" | 11 #include "ash/display/window_tree_host_manager.h" |
10 #include "ash/shelf/shelf_constants.h" | |
11 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
12 #include "ash/shelf/shelf_types.h" | |
13 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
16 #include "ui/display/display.h" | 16 #include "ui/display/display.h" |
17 #include "ui/display/screen.h" | 17 #include "ui/display/screen.h" |
18 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
19 #include "ui/message_center/message_center_style.h" | 19 #include "ui/message_center/message_center_style.h" |
20 #include "ui/message_center/views/message_popup_collection.h" | 20 #include "ui/message_center/views/message_popup_collection.h" |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 int AshPopupAlignmentDelegate::GetWorkAreaBottom() const { | 93 int AshPopupAlignmentDelegate::GetWorkAreaBottom() const { |
94 return work_area_.bottom() - system_tray_height_; | 94 return work_area_.bottom() - system_tray_height_; |
95 } | 95 } |
96 | 96 |
97 bool AshPopupAlignmentDelegate::IsTopDown() const { | 97 bool AshPopupAlignmentDelegate::IsTopDown() const { |
98 return false; | 98 return false; |
99 } | 99 } |
100 | 100 |
101 bool AshPopupAlignmentDelegate::IsFromLeft() const { | 101 bool AshPopupAlignmentDelegate::IsFromLeft() const { |
102 return GetAlignment() == wm::SHELF_ALIGNMENT_LEFT; | 102 return GetAlignment() == SHELF_ALIGNMENT_LEFT; |
103 } | 103 } |
104 | 104 |
105 void AshPopupAlignmentDelegate::RecomputeAlignment( | 105 void AshPopupAlignmentDelegate::RecomputeAlignment( |
106 const display::Display& display) { | 106 const display::Display& display) { |
107 // Nothing needs to be done. | 107 // Nothing needs to be done. |
108 } | 108 } |
109 | 109 |
110 wm::ShelfAlignment AshPopupAlignmentDelegate::GetAlignment() const { | 110 ShelfAlignment AshPopupAlignmentDelegate::GetAlignment() const { |
111 return shelf_->GetAlignment(); | 111 return shelf_->GetAlignment(); |
112 } | 112 } |
113 | 113 |
114 display::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { | 114 display::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { |
115 return WmLookup::Get() | 115 return WmLookup::Get() |
116 ->GetWindowForWidget(shelf_->shelf_widget()) | 116 ->GetWindowForWidget(shelf_->shelf_widget()) |
117 ->GetDisplayNearestWindow(); | 117 ->GetDisplayNearestWindow(); |
118 } | 118 } |
119 | 119 |
120 void AshPopupAlignmentDelegate::UpdateWorkArea() { | 120 void AshPopupAlignmentDelegate::UpdateWorkArea() { |
(...skipping 22 matching lines...) Expand all Loading... |
143 const display::Display& old_display) {} | 143 const display::Display& old_display) {} |
144 | 144 |
145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
146 const display::Display& display, | 146 const display::Display& display, |
147 uint32_t metrics) { | 147 uint32_t metrics) { |
148 if (GetCurrentDisplay().id() == display.id()) | 148 if (GetCurrentDisplay().id() == display.id()) |
149 UpdateWorkArea(); | 149 UpdateWorkArea(); |
150 } | 150 } |
151 | 151 |
152 } // namespace ash | 152 } // namespace ash |
OLD | NEW |