| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/immersive_fullscreen_controller.h" | 5 #include "ash/wm/immersive_fullscreen_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 // Start / stop observing changes to |bubble|'s visibility. | 137 // Start / stop observing changes to |bubble|'s visibility. |
| 138 void StartObserving(aura::Window* bubble); | 138 void StartObserving(aura::Window* bubble); |
| 139 void StopObserving(aura::Window* bubble); | 139 void StopObserving(aura::Window* bubble); |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 // Updates |revealed_lock_| based on whether any of |bubbles_| is visible. | 142 // Updates |revealed_lock_| based on whether any of |bubbles_| is visible. |
| 143 void UpdateRevealedLock(); | 143 void UpdateRevealedLock(); |
| 144 | 144 |
| 145 // aura::WindowObserver overrides: | 145 // aura::WindowObserver overrides: |
| 146 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 146 void OnWindowVisibilityChanged(aura::Window* window, |
| 147 bool visible, |
| 148 bool content_visible) override; |
| 147 void OnWindowDestroying(aura::Window* window) override; | 149 void OnWindowDestroying(aura::Window* window) override; |
| 148 | 150 |
| 149 ImmersiveFullscreenController* controller_; | 151 ImmersiveFullscreenController* controller_; |
| 150 | 152 |
| 151 std::set<aura::Window*> bubbles_; | 153 std::set<aura::Window*> bubbles_; |
| 152 | 154 |
| 153 // Lock which keeps the top-of-window views revealed based on whether any of | 155 // Lock which keeps the top-of-window views revealed based on whether any of |
| 154 // |bubbles_| is visible. | 156 // |bubbles_| is visible. |
| 155 scoped_ptr<ImmersiveRevealedLock> revealed_lock_; | 157 scoped_ptr<ImmersiveRevealedLock> revealed_lock_; |
| 156 | 158 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // visibility change. | 218 // visibility change. |
| 217 for (std::set<aura::Window*>::const_iterator it = bubbles_.begin(); | 219 for (std::set<aura::Window*>::const_iterator it = bubbles_.begin(); |
| 218 it != bubbles_.end(); ++it) { | 220 it != bubbles_.end(); ++it) { |
| 219 AsBubbleDelegate(*it)->OnAnchorBoundsChanged(); | 221 AsBubbleDelegate(*it)->OnAnchorBoundsChanged(); |
| 220 } | 222 } |
| 221 } | 223 } |
| 222 } | 224 } |
| 223 | 225 |
| 224 void ImmersiveFullscreenController::BubbleManager::OnWindowVisibilityChanged( | 226 void ImmersiveFullscreenController::BubbleManager::OnWindowVisibilityChanged( |
| 225 aura::Window*, | 227 aura::Window*, |
| 226 bool visible) { | 228 bool visible, |
| 229 bool content_visible) { |
| 227 UpdateRevealedLock(); | 230 UpdateRevealedLock(); |
| 228 } | 231 } |
| 229 | 232 |
| 230 void ImmersiveFullscreenController::BubbleManager::OnWindowDestroying( | 233 void ImmersiveFullscreenController::BubbleManager::OnWindowDestroying( |
| 231 aura::Window* window) { | 234 aura::Window* window) { |
| 232 StopObserving(window); | 235 StopObserving(window); |
| 233 } | 236 } |
| 234 | 237 |
| 235 //////////////////////////////////////////////////////////////////////////////// | 238 //////////////////////////////////////////////////////////////////////////////// |
| 236 | 239 |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 AsBubbleDelegate(transient_child); | 950 AsBubbleDelegate(transient_child); |
| 948 if (bubble_delegate && | 951 if (bubble_delegate && |
| 949 bubble_delegate->GetAnchorView() && | 952 bubble_delegate->GetAnchorView() && |
| 950 top_container_->Contains(bubble_delegate->GetAnchorView())) { | 953 top_container_->Contains(bubble_delegate->GetAnchorView())) { |
| 951 bubble_manager_->StartObserving(transient_child); | 954 bubble_manager_->StartObserving(transient_child); |
| 952 } | 955 } |
| 953 } | 956 } |
| 954 } | 957 } |
| 955 | 958 |
| 956 } // namespace ash | 959 } // namespace ash |
| OLD | NEW |