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/display/window_tree_host_manager.h" | 7 #include "ash/display/window_tree_host_manager.h" |
8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 int AshPopupAlignmentDelegate::GetWorkAreaBottom() const { | 92 int AshPopupAlignmentDelegate::GetWorkAreaBottom() const { |
93 return work_area_.bottom() - system_tray_height_; | 93 return work_area_.bottom() - system_tray_height_; |
94 } | 94 } |
95 | 95 |
96 bool AshPopupAlignmentDelegate::IsTopDown() const { | 96 bool AshPopupAlignmentDelegate::IsTopDown() const { |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 bool AshPopupAlignmentDelegate::IsFromLeft() const { | 100 bool AshPopupAlignmentDelegate::IsFromLeft() const { |
101 return GetAlignment() == SHELF_ALIGNMENT_LEFT; | 101 return GetAlignment() == wm::SHELF_ALIGNMENT_LEFT; |
102 } | 102 } |
103 | 103 |
104 void AshPopupAlignmentDelegate::RecomputeAlignment( | 104 void AshPopupAlignmentDelegate::RecomputeAlignment( |
105 const gfx::Display& display) { | 105 const gfx::Display& display) { |
106 // Nothing needs to be done. | 106 // Nothing needs to be done. |
107 } | 107 } |
108 | 108 |
109 ShelfAlignment AshPopupAlignmentDelegate::GetAlignment() const { | 109 wm::ShelfAlignment AshPopupAlignmentDelegate::GetAlignment() const { |
110 return shelf_->GetAlignment(); | 110 return shelf_->GetAlignment(); |
111 } | 111 } |
112 | 112 |
113 gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { | 113 gfx::Display AshPopupAlignmentDelegate::GetCurrentDisplay() const { |
114 return gfx::Screen::GetScreen()->GetDisplayNearestWindow( | 114 return gfx::Screen::GetScreen()->GetDisplayNearestWindow( |
115 shelf_->shelf_widget()->GetNativeView()); | 115 shelf_->shelf_widget()->GetNativeView()); |
116 } | 116 } |
117 | 117 |
118 void AshPopupAlignmentDelegate::UpdateWorkArea() { | 118 void AshPopupAlignmentDelegate::UpdateWorkArea() { |
119 work_area_ = shelf_->user_work_area_bounds(); | 119 work_area_ = shelf_->user_work_area_bounds(); |
(...skipping 23 matching lines...) Expand all Loading... |
143 } | 143 } |
144 | 144 |
145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 145 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
146 const gfx::Display& display, | 146 const gfx::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 |