Chromium Code Reviews| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 } | 267 } |
| 268 | 268 |
| 269 void ImmersiveFullscreenController::SetEnabled(WindowType window_type, | 269 void ImmersiveFullscreenController::SetEnabled(WindowType window_type, |
| 270 bool enabled) { | 270 bool enabled) { |
| 271 if (enabled_ == enabled) | 271 if (enabled_ == enabled) |
| 272 return; | 272 return; |
| 273 enabled_ = enabled; | 273 enabled_ = enabled; |
| 274 | 274 |
| 275 EnableWindowObservers(enabled_); | 275 EnableWindowObservers(enabled_); |
| 276 | 276 |
| 277 ash::wm::WindowState* window_state = wm::GetWindowState(native_window_); | |
| 277 // Auto hide the shelf in immersive fullscreen instead of hiding it. | 278 // Auto hide the shelf in immersive fullscreen instead of hiding it. |
| 278 wm::GetWindowState(native_window_)->set_hide_shelf_when_fullscreen(!enabled); | 279 window_state->set_hide_shelf_when_fullscreen(!enabled); |
| 279 Shell::GetInstance()->UpdateShelfVisibility(); | 280 Shell::GetInstance()->UpdateShelfVisibility(); |
| 280 | 281 |
| 282 // Mark a browser window as an immersive mode window so that the | |
|
pkotwicz
2014/06/02 22:27:58
Can you please update this comment?
Can this be c
Mr4D (OOO till 08-26)
2014/06/03 14:36:40
Done.
| |
| 283 // window manager can treat it accordingly. | |
| 284 window_state->set_in_immersive_fullscreen(enabled); | |
| 285 | |
| 281 if (enabled_) { | 286 if (enabled_) { |
| 282 // Animate enabling immersive mode by sliding out the top-of-window views. | 287 // Animate enabling immersive mode by sliding out the top-of-window views. |
| 283 // No animation occurs if a lock is holding the top-of-window views open. | 288 // No animation occurs if a lock is holding the top-of-window views open. |
| 284 | 289 |
| 285 // Do a reveal to set the initial state for the animation. (And any | 290 // Do a reveal to set the initial state for the animation. (And any |
| 286 // required state in case the animation cannot run because of a lock holding | 291 // required state in case the animation cannot run because of a lock holding |
| 287 // the top-of-window views open.) | 292 // the top-of-window views open.) |
| 288 MaybeStartReveal(ANIMATE_NO); | 293 MaybeStartReveal(ANIMATE_NO); |
| 289 | 294 |
| 290 // Reset the located event and the focus revealed locks so that they do not | 295 // Reset the located event and the focus revealed locks so that they do not |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 943 AsBubbleDelegate(transient_child); | 948 AsBubbleDelegate(transient_child); |
| 944 if (bubble_delegate && | 949 if (bubble_delegate && |
| 945 bubble_delegate->GetAnchorView() && | 950 bubble_delegate->GetAnchorView() && |
| 946 top_container_->Contains(bubble_delegate->GetAnchorView())) { | 951 top_container_->Contains(bubble_delegate->GetAnchorView())) { |
| 947 bubble_manager_->StartObserving(transient_child); | 952 bubble_manager_->StartObserving(transient_child); |
| 948 } | 953 } |
| 949 } | 954 } |
| 950 } | 955 } |
| 951 | 956 |
| 952 } // namespace ash | 957 } // namespace ash |
| OLD | NEW |