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/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shelf/shelf_constants.h" | 8 #include "ash/shelf/shelf_constants.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 screen_->RemoveObserver(this); | 44 screen_->RemoveObserver(this); |
45 Shell::GetInstance()->RemoveShellObserver(this); | 45 Shell::GetInstance()->RemoveShellObserver(this); |
46 if (shelf_) | 46 if (shelf_) |
47 shelf_->RemoveObserver(this); | 47 shelf_->RemoveObserver(this); |
48 } | 48 } |
49 | 49 |
50 void AshPopupAlignmentDelegate::StartObserving(gfx::Screen* screen, | 50 void AshPopupAlignmentDelegate::StartObserving(gfx::Screen* screen, |
51 const gfx::Display& display) { | 51 const gfx::Display& display) { |
52 screen_ = screen; | 52 screen_ = screen; |
53 display_id_ = display.id(); | 53 display_id_ = display.id(); |
| 54 work_area_ = display.work_area(); |
54 root_window_ = ash::Shell::GetInstance()->display_controller()-> | 55 root_window_ = ash::Shell::GetInstance()->display_controller()-> |
55 GetRootWindowForDisplayId(display_id_); | 56 GetRootWindowForDisplayId(display_id_); |
56 UpdateShelf(); | 57 UpdateShelf(); |
57 screen->AddObserver(this); | 58 screen->AddObserver(this); |
58 Shell::GetInstance()->AddShellObserver(this); | 59 Shell::GetInstance()->AddShellObserver(this); |
59 if (system_tray_height_ > 0) | 60 if (system_tray_height_ > 0) |
60 OnAutoHideStateChanged(shelf_->auto_hide_state()); | 61 OnAutoHideStateChanged(shelf_->auto_hide_state()); |
61 } | 62 } |
62 | 63 |
63 void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) { | 64 void AshPopupAlignmentDelegate::SetSystemTrayHeight(int height) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 168 } |
168 | 169 |
169 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( | 170 void AshPopupAlignmentDelegate::OnDisplayMetricsChanged( |
170 const gfx::Display& display, | 171 const gfx::Display& display, |
171 uint32_t metrics) { | 172 uint32_t metrics) { |
172 if (display.id() == display_id_ && shelf_) | 173 if (display.id() == display_id_ && shelf_) |
173 OnAutoHideStateChanged(shelf_->auto_hide_state()); | 174 OnAutoHideStateChanged(shelf_->auto_hide_state()); |
174 } | 175 } |
175 | 176 |
176 } // namespace ash | 177 } // namespace ash |
OLD | NEW |