Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc

Issue 309793005: Fixing problem with edge swipe exiting immersive mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/window_state.h" 8 #include "ash/wm/window_state.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 browser_view_ = browser_view; 59 browser_view_ = browser_view;
60 native_window_ = browser_view_->GetNativeWindow(); 60 native_window_ = browser_view_->GetNativeWindow();
61 controller_->Init(this, browser_view_->frame(), 61 controller_->Init(this, browser_view_->frame(),
62 browser_view_->top_container()); 62 browser_view_->top_container());
63 } 63 }
64 64
65 void ImmersiveModeControllerAsh::SetEnabled(bool enabled) { 65 void ImmersiveModeControllerAsh::SetEnabled(bool enabled) {
66 if (controller_->IsEnabled() == enabled) 66 if (controller_->IsEnabled() == enabled)
67 return; 67 return;
68 68
69 if (!browser_view_->browser()->is_app()) {
70 // Mark a browser window as an immersive mode window so that the
71 // window manager can treat it accordingly.
72 ash::wm::GetWindowState(native_window_)->set_immersive_mode(enabled);
73 }
74
69 EnableWindowObservers(enabled); 75 EnableWindowObservers(enabled);
70 76
71 controller_->SetEnabled(browser_view_->browser()->is_app() ? 77 controller_->SetEnabled(browser_view_->browser()->is_app() ?
72 ash::ImmersiveFullscreenController::WINDOW_TYPE_HOSTED_APP : 78 ash::ImmersiveFullscreenController::WINDOW_TYPE_HOSTED_APP :
73 ash::ImmersiveFullscreenController::WINDOW_TYPE_BROWSER 79 ash::ImmersiveFullscreenController::WINDOW_TYPE_BROWSER
74 , enabled); 80 , enabled);
75 } 81 }
76 82
77 bool ImmersiveModeControllerAsh::IsEnabled() const { 83 bool ImmersiveModeControllerAsh::IsEnabled() const {
78 return controller_->IsEnabled(); 84 return controller_->IsEnabled();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // prevent it from being revealed. 247 // prevent it from being revealed.
242 bool in_tab_fullscreen = content::Source<FullscreenController>(source)-> 248 bool in_tab_fullscreen = content::Source<FullscreenController>(source)->
243 IsWindowFullscreenForTabOrPending(); 249 IsWindowFullscreenForTabOrPending();
244 ash::wm::GetWindowState(native_window_)->set_hide_shelf_when_fullscreen( 250 ash::wm::GetWindowState(native_window_)->set_hide_shelf_when_fullscreen(
245 in_tab_fullscreen); 251 in_tab_fullscreen);
246 ash::Shell::GetInstance()->UpdateShelfVisibility(); 252 ash::Shell::GetInstance()->UpdateShelfVisibility();
247 253
248 if (tab_indicator_visibility_changed) 254 if (tab_indicator_visibility_changed)
249 LayoutBrowserRootView(); 255 LayoutBrowserRootView();
250 } 256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698