| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/shared/immersive_revealed_lock.h" | 9 #include "ash/shared/immersive_revealed_lock.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // window manager are visible. | 280 // window manager are visible. |
| 281 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 281 init_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 282 const gfx::Rect& top_container_bounds = | 282 const gfx::Rect& top_container_bounds = |
| 283 browser_view_->top_container()->bounds(); | 283 browser_view_->top_container()->bounds(); |
| 284 init_params.bounds = | 284 init_params.bounds = |
| 285 gfx::Rect(0, -top_container_bounds.height(), top_container_bounds.width(), | 285 gfx::Rect(0, -top_container_bounds.height(), top_container_bounds.width(), |
| 286 top_container_bounds.height()); | 286 top_container_bounds.height()); |
| 287 mash_reveal_widget_->Init(init_params); | 287 mash_reveal_widget_->Init(init_params); |
| 288 mash_reveal_widget_->SetContentsView( | 288 mash_reveal_widget_->SetContentsView( |
| 289 new TopContainerMirrorView(browser_view_->top_container())); | 289 new TopContainerMirrorView(browser_view_->top_container())); |
| 290 // Disable the default animation as we want to the window to slide in nicely, | |
| 291 // not slide and inherit the default window animations. | |
| 292 mash_reveal_widget_->GetNativeWindow()->SetProperty( | |
| 293 aura::client::kAnimationsDisabledKey, true); | |
| 294 mash_reveal_widget_->StackAtTop(); | 290 mash_reveal_widget_->StackAtTop(); |
| 295 mash_reveal_widget_->Show(); | 291 mash_reveal_widget_->Show(); |
| 296 } | 292 } |
| 297 | 293 |
| 298 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { | 294 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { |
| 299 mash_reveal_widget_.reset(); | 295 mash_reveal_widget_.reset(); |
| 300 } | 296 } |
| 301 | 297 |
| 302 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { | 298 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { |
| 303 DestroyMashRevealWidget(); | 299 DestroyMashRevealWidget(); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 const void* key, | 410 const void* key, |
| 415 intptr_t old) { | 411 intptr_t old) { |
| 416 // In mash the window manager may move us out of immersive mode by changing | 412 // In mash the window manager may move us out of immersive mode by changing |
| 417 // the show state. When this happens notify the controller. | 413 // the show state. When this happens notify the controller. |
| 418 DCHECK(chrome::IsRunningInMash()); | 414 DCHECK(chrome::IsRunningInMash()); |
| 419 if (key == aura::client::kShowStateKey && | 415 if (key == aura::client::kShowStateKey && |
| 420 !browser_view_->GetWidget()->IsFullscreen()) { | 416 !browser_view_->GetWidget()->IsFullscreen()) { |
| 421 SetEnabled(false); | 417 SetEnabled(false); |
| 422 } | 418 } |
| 423 } | 419 } |
| OLD | NEW |