| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // views revealed based on the visibility of bubbles anchored to | 125 // views revealed based on the visibility of bubbles anchored to |
| 126 // children of |ImmersiveFullscreenController::top_container_| is separate from | 126 // children of |ImmersiveFullscreenController::top_container_| is separate from |
| 127 // the logic related to |ImmersiveFullscreenController::focus_revealed_lock_| | 127 // the logic related to |ImmersiveFullscreenController::focus_revealed_lock_| |
| 128 // so that bubbles which are not activatable and bubbles which do not close | 128 // so that bubbles which are not activatable and bubbles which do not close |
| 129 // upon deactivation also keep the top-of-window views revealed for the | 129 // upon deactivation also keep the top-of-window views revealed for the |
| 130 // duration of their visibility. | 130 // duration of their visibility. |
| 131 class ImmersiveFullscreenController::BubbleManager | 131 class ImmersiveFullscreenController::BubbleManager |
| 132 : public aura::WindowObserver { | 132 : public aura::WindowObserver { |
| 133 public: | 133 public: |
| 134 explicit BubbleManager(ImmersiveFullscreenController* controller); | 134 explicit BubbleManager(ImmersiveFullscreenController* controller); |
| 135 virtual ~BubbleManager(); | 135 ~BubbleManager() override; |
| 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 virtual void OnWindowVisibilityChanged(aura::Window* window, | 146 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
| 147 bool visible) override; | 147 void OnWindowDestroying(aura::Window* window) override; |
| 148 virtual void OnWindowDestroying(aura::Window* window) override; | |
| 149 | 148 |
| 150 ImmersiveFullscreenController* controller_; | 149 ImmersiveFullscreenController* controller_; |
| 151 | 150 |
| 152 std::set<aura::Window*> bubbles_; | 151 std::set<aura::Window*> bubbles_; |
| 153 | 152 |
| 154 // Lock which keeps the top-of-window views revealed based on whether any of | 153 // Lock which keeps the top-of-window views revealed based on whether any of |
| 155 // |bubbles_| is visible. | 154 // |bubbles_| is visible. |
| 156 scoped_ptr<ImmersiveRevealedLock> revealed_lock_; | 155 scoped_ptr<ImmersiveRevealedLock> revealed_lock_; |
| 157 | 156 |
| 158 DISALLOW_COPY_AND_ASSIGN(BubbleManager); | 157 DISALLOW_COPY_AND_ASSIGN(BubbleManager); |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 AsBubbleDelegate(transient_child); | 947 AsBubbleDelegate(transient_child); |
| 949 if (bubble_delegate && | 948 if (bubble_delegate && |
| 950 bubble_delegate->GetAnchorView() && | 949 bubble_delegate->GetAnchorView() && |
| 951 top_container_->Contains(bubble_delegate->GetAnchorView())) { | 950 top_container_->Contains(bubble_delegate->GetAnchorView())) { |
| 952 bubble_manager_->StartObserving(transient_child); | 951 bubble_manager_->StartObserving(transient_child); |
| 953 } | 952 } |
| 954 } | 953 } |
| 955 } | 954 } |
| 956 | 955 |
| 957 } // namespace ash | 956 } // namespace ash |
| OLD | NEW |