| 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_->OnDisplayMetricsChanged( | 161 collection_->OnDisplayBoundsChanged( |
| 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); | |
| 165 } | 164 } |
| 166 | 165 |
| 167 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { | 166 void WorkAreaObserver::OnAutoHideStateChanged(ShelfAutoHideState new_state) { |
| 168 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( | 167 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( |
| 169 shelf_->shelf_widget()->GetNativeView()); | 168 shelf_->shelf_widget()->GetNativeView()); |
| 170 gfx::Rect work_area = display.work_area(); | 169 gfx::Rect work_area = display.work_area(); |
| 171 int width = 0; | 170 int width = 0; |
| 172 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && | 171 if ((shelf_->visibility_state() == SHELF_AUTO_HIDE) && |
| 173 new_state == SHELF_AUTO_HIDE_SHOWN) { | 172 new_state == SHELF_AUTO_HIDE_SHOWN) { |
| 174 // Since the work_area is already reduced by kAutoHideSize, the inset width | 173 // 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... |
| 613 | 612 |
| 614 message_center::MessageCenterBubble* | 613 message_center::MessageCenterBubble* |
| 615 WebNotificationTray::GetMessageCenterBubbleForTest() { | 614 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 616 if (!message_center_bubble()) | 615 if (!message_center_bubble()) |
| 617 return NULL; | 616 return NULL; |
| 618 return static_cast<message_center::MessageCenterBubble*>( | 617 return static_cast<message_center::MessageCenterBubble*>( |
| 619 message_center_bubble()->bubble()); | 618 message_center_bubble()->bubble()); |
| 620 } | 619 } |
| 621 | 620 |
| 622 } // namespace ash | 621 } // namespace ash |
| OLD | NEW |