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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { | 255 void ImmersiveModeControllerAsh::DestroyMashRevealWidget() { |
256 mash_reveal_widget_.reset(); | 256 mash_reveal_widget_.reset(); |
257 } | 257 } |
258 | 258 |
259 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { | 259 void ImmersiveModeControllerAsh::OnImmersiveRevealStarted() { |
260 DestroyMashRevealWidget(); | 260 DestroyMashRevealWidget(); |
261 | 261 |
262 visible_fraction_ = 0; | 262 visible_fraction_ = 0; |
263 browser_view_->top_container()->SetPaintToLayer(true); | 263 browser_view_->top_container()->SetPaintToLayer(); |
264 browser_view_->top_container()->layer()->SetFillsBoundsOpaquely(false); | 264 browser_view_->top_container()->layer()->SetFillsBoundsOpaquely(false); |
265 UpdateTabIndicators(); | 265 UpdateTabIndicators(); |
266 LayoutBrowserRootView(); | 266 LayoutBrowserRootView(); |
267 CreateMashRevealWidget(); | 267 CreateMashRevealWidget(); |
268 for (Observer& observer : observers_) | 268 for (Observer& observer : observers_) |
269 observer.OnImmersiveRevealStarted(); | 269 observer.OnImmersiveRevealStarted(); |
270 } | 270 } |
271 | 271 |
272 void ImmersiveModeControllerAsh::OnImmersiveRevealEnded() { | 272 void ImmersiveModeControllerAsh::OnImmersiveRevealEnded() { |
273 DestroyMashRevealWidget(); | 273 DestroyMashRevealWidget(); |
274 visible_fraction_ = 0; | 274 visible_fraction_ = 0; |
275 browser_view_->top_container()->SetPaintToLayer(false); | 275 browser_view_->top_container()->DestroyLayer(); |
276 UpdateTabIndicators(); | 276 UpdateTabIndicators(); |
277 LayoutBrowserRootView(); | 277 LayoutBrowserRootView(); |
278 } | 278 } |
279 | 279 |
280 void ImmersiveModeControllerAsh::OnImmersiveFullscreenExited() { | 280 void ImmersiveModeControllerAsh::OnImmersiveFullscreenExited() { |
281 DestroyMashRevealWidget(); | 281 DestroyMashRevealWidget(); |
282 browser_view_->top_container()->SetPaintToLayer(false); | 282 browser_view_->top_container()->DestroyLayer(); |
283 UpdateTabIndicators(); | 283 UpdateTabIndicators(); |
284 LayoutBrowserRootView(); | 284 LayoutBrowserRootView(); |
285 } | 285 } |
286 | 286 |
287 void ImmersiveModeControllerAsh::SetVisibleFraction(double visible_fraction) { | 287 void ImmersiveModeControllerAsh::SetVisibleFraction(double visible_fraction) { |
288 if (visible_fraction_ != visible_fraction) { | 288 if (visible_fraction_ != visible_fraction) { |
289 visible_fraction_ = visible_fraction; | 289 visible_fraction_ = visible_fraction; |
290 browser_view_->Layout(); | 290 browser_view_->Layout(); |
291 | 291 |
292 if (mash_reveal_widget_) { | 292 if (mash_reveal_widget_) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // the shelf completely and prevent it from being revealed. | 351 // the shelf completely and prevent it from being revealed. |
352 bool in_tab_fullscreen = content::Source<FullscreenController>(source)-> | 352 bool in_tab_fullscreen = content::Source<FullscreenController>(source)-> |
353 IsWindowFullscreenForTabOrPending(); | 353 IsWindowFullscreenForTabOrPending(); |
354 ash::wm::GetWindowState(native_window_) | 354 ash::wm::GetWindowState(native_window_) |
355 ->set_hide_shelf_when_fullscreen(in_tab_fullscreen); | 355 ->set_hide_shelf_when_fullscreen(in_tab_fullscreen); |
356 ash::Shell::GetInstance()->UpdateShelfVisibility(); | 356 ash::Shell::GetInstance()->UpdateShelfVisibility(); |
357 | 357 |
358 if (tab_indicator_visibility_changed) | 358 if (tab_indicator_visibility_changed) |
359 LayoutBrowserRootView(); | 359 LayoutBrowserRootView(); |
360 } | 360 } |
OLD | NEW |