| 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/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 mouse_over_shelf_when_auto_hide_timer_started_(false), | 149 mouse_over_shelf_when_auto_hide_timer_started_(false), |
| 150 gesture_drag_status_(GESTURE_DRAG_NONE), | 150 gesture_drag_status_(GESTURE_DRAG_NONE), |
| 151 gesture_drag_amount_(0.f), | 151 gesture_drag_amount_(0.f), |
| 152 gesture_drag_auto_hide_state_(SHELF_AUTO_HIDE_SHOWN), | 152 gesture_drag_auto_hide_state_(SHELF_AUTO_HIDE_SHOWN), |
| 153 update_shelf_observer_(NULL), | 153 update_shelf_observer_(NULL), |
| 154 chromevox_panel_height_(0), | 154 chromevox_panel_height_(0), |
| 155 duration_override_in_ms_(0), | 155 duration_override_in_ms_(0), |
| 156 shelf_background_type_(SHELF_BACKGROUND_OVERLAP) { | 156 shelf_background_type_(SHELF_BACKGROUND_OVERLAP) { |
| 157 DCHECK(shelf_widget_); | 157 DCHECK(shelf_widget_); |
| 158 DCHECK(wm_shelf_); | 158 DCHECK(wm_shelf_); |
| 159 WmShell::Get()->AddShellObserver(this); | 159 Shell::GetInstance()->AddShellObserver(this); |
| 160 WmShell::Get()->AddLockStateObserver(this); | 160 WmShell::Get()->AddLockStateObserver(this); |
| 161 Shell::GetInstance()->activation_client()->AddObserver(this); | 161 Shell::GetInstance()->activation_client()->AddObserver(this); |
| 162 WmShell::Get()->session_controller()->AddSessionStateObserver(this); | 162 WmShell::Get()->session_controller()->AddSessionStateObserver(this); |
| 163 state_.session_state = | 163 state_.session_state = |
| 164 WmShell::Get()->session_controller()->GetSessionState(); | 164 WmShell::Get()->session_controller()->GetSessionState(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 ShelfLayoutManager::~ShelfLayoutManager() { | 167 ShelfLayoutManager::~ShelfLayoutManager() { |
| 168 if (update_shelf_observer_) | 168 if (update_shelf_observer_) |
| 169 update_shelf_observer_->Detach(); | 169 update_shelf_observer_->Detach(); |
| 170 | 170 |
| 171 for (auto& observer : observers_) | 171 for (auto& observer : observers_) |
| 172 observer.WillDeleteShelfLayoutManager(); | 172 observer.WillDeleteShelfLayoutManager(); |
| 173 WmShell::Get()->RemoveShellObserver(this); | 173 Shell::GetInstance()->RemoveShellObserver(this); |
| 174 WmShell::Get()->RemoveLockStateObserver(this); | 174 WmShell::Get()->RemoveLockStateObserver(this); |
| 175 WmShell::Get()->session_controller()->RemoveSessionStateObserver(this); | 175 WmShell::Get()->session_controller()->RemoveSessionStateObserver(this); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void ShelfLayoutManager::PrepareForShutdown() { | 178 void ShelfLayoutManager::PrepareForShutdown() { |
| 179 in_shutdown_ = true; | 179 in_shutdown_ = true; |
| 180 // Stop observing changes to avoid updating a partially destructed shelf. | 180 // Stop observing changes to avoid updating a partially destructed shelf. |
| 181 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 181 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
| 182 } | 182 } |
| 183 | 183 |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1137 gesture_drag_status_ = GESTURE_DRAG_NONE; |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 void ShelfLayoutManager::CancelGestureDrag() { | 1140 void ShelfLayoutManager::CancelGestureDrag() { |
| 1141 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1141 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
| 1142 UpdateVisibilityState(); | 1142 UpdateVisibilityState(); |
| 1143 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1143 gesture_drag_status_ = GESTURE_DRAG_NONE; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace ash | 1146 } // namespace ash |
| OLD | NEW |