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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 249 |
250 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { | 250 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { |
251 mash_reveal_widget_.reset(); | 251 mash_reveal_widget_.reset(); |
252 } | 252 } |
253 | 253 |
254 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { | 254 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { |
255 DestroyMashRevealWidget(); | 255 DestroyMashRevealWidget(); |
256 | 256 |
257 visible_fraction_ = 0; | 257 visible_fraction_ = 0; |
258 browser_view_->top_container()->SetPaintToLayer(); | 258 browser_view_->top_container()->SetPaintToLayer(); |
259 // In mash the window manager (ash) also renders to the non-client area. In | 259 browser_view_->top_container()->layer()->SetFillsBoundsOpaquely(false); |
260 // order to see the decorations drawn by ash the layer needs to be marked as | |
261 // not filling bounds opaquely. | |
262 if (ash_util::IsRunningInMash()) | |
263 browser_view_->top_container()->layer()->SetFillsBoundsOpaquely(false); | |
264 LayoutBrowserRootView(); | 260 LayoutBrowserRootView(); |
265 CreateMashRevealWidget(); | 261 CreateMashRevealWidget(); |
266 for (Observer& observer : observers_) | 262 for (Observer& observer : observers_) |
267 observer.OnImmersiveRevealStarted(); | 263 observer.OnImmersiveRevealStarted(); |
268 } | 264 } |
269 | 265 |
270 void ImmersiveModeControllerAsh::OnImmersiveRevealEnded() { | 266 void ImmersiveModeControllerAsh::OnImmersiveRevealEnded() { |
271 DestroyMashRevealWidget(); | 267 DestroyMashRevealWidget(); |
272 visible_fraction_ = 0; | 268 visible_fraction_ = 0; |
273 browser_view_->top_container()->DestroyLayer(); | 269 browser_view_->top_container()->DestroyLayer(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 const void* key, | 351 const void* key, |
356 intptr_t old) { | 352 intptr_t old) { |
357 // In mash the window manager may move us out of immersive mode by changing | 353 // In mash the window manager may move us out of immersive mode by changing |
358 // the show state. When this happens notify the controller. | 354 // the show state. When this happens notify the controller. |
359 DCHECK(ash_util::IsRunningInMash()); | 355 DCHECK(ash_util::IsRunningInMash()); |
360 if (key == aura::client::kShowStateKey && | 356 if (key == aura::client::kShowStateKey && |
361 !browser_view_->GetWidget()->IsFullscreen()) { | 357 !browser_view_->GetWidget()->IsFullscreen()) { |
362 SetEnabled(false); | 358 SetEnabled(false); |
363 } | 359 } |
364 } | 360 } |
OLD | NEW |