OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_layout_manager_observer.h" | 10 #include "ash/shelf/shelf_layout_manager_observer.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 Shell::GetInstance()->RemoveShellObserver(this); | 151 Shell::GetInstance()->RemoveShellObserver(this); |
152 if (shelf_) | 152 if (shelf_) |
153 shelf_->RemoveObserver(this); | 153 shelf_->RemoveObserver(this); |
154 collection_ = NULL; | 154 collection_ = NULL; |
155 shelf_ = NULL; | 155 shelf_ = NULL; |
156 } | 156 } |
157 | 157 |
158 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() { | 158 void WorkAreaObserver::OnDisplayWorkAreaInsetsChanged() { |
159 UpdateShelf(); | 159 UpdateShelf(); |
160 | 160 |
161 collection_->OnDisplayBoundsChanged( | 161 collection_->OnDisplayMetricsChanged( |
162 Shell::GetScreen()->GetDisplayNearestWindow( | 162 Shell::GetScreen()->GetDisplayNearestWindow( |
163 shelf_->shelf_widget()->GetNativeView())); | 163 shelf_->shelf_widget()->GetNativeView()), |
| 164 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA); |
164 } | 165 } |
165 | 166 |
166 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { | 167 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { |
167 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( | 168 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( |
168 shelf_->shelf_widget()->GetNativeView()); | 169 shelf_->shelf_widget()->GetNativeView()); |
169 gfx::Rect work_area = display.work_area(); | 170 gfx::Rect work_area = display.work_area(); |
170 int width = 0; | 171 int width = 0; |
171 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && | 172 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && |
172 new_state == SHELF_AUTO_HIDE_SHOWN) { | 173 new_state == SHELF_AUTO_HIDE_SHOWN) { |
173 // Since the work_area is already reduced by kAutoHideSize, the inset width | 174 // Since the work_area is already reduced by kAutoHideSize, the inset width |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 613 |
613 message_center::MessageCenterBubble* | 614 message_center::MessageCenterBubble* |
614 WebNotificationTray::GetMessageCenterBubbleForTest() { | 615 WebNotificationTray::GetMessageCenterBubbleForTest() { |
615 if (!message_center_bubble()) | 616 if (!message_center_bubble()) |
616 return NULL; | 617 return NULL; |
617 return static_cast<message_center::MessageCenterBubble*>( | 618 return static_cast<message_center::MessageCenterBubble*>( |
618 message_center_bubble()->bubble()); | 619 message_center_bubble()->bubble()); |
619 } | 620 } |
620 | 621 |
621 } // namespace ash | 622 } // namespace ash |
OLD | NEW |