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

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

Issue 83343006: Enable immersive fullscreen for hosted apps part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 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 "chrome/browser/ui/views/frame/browser_frame_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_frame_ash.h"
6 6
7 #include "ash/wm/window_state.h" 7 #include "ash/wm/window_state.h"
8 #include "ash/wm/window_state_delegate.h" 8 #include "ash/wm/window_state_delegate.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 BrowserView* browser_view) 56 BrowserView* browser_view)
57 : views::NativeWidgetAura(browser_frame), 57 : views::NativeWidgetAura(browser_frame),
58 browser_view_(browser_view) { 58 browser_view_(browser_view) {
59 GetNativeWindow()->SetName(kWindowName); 59 GetNativeWindow()->SetName(kWindowName);
60 Browser* browser = browser_view->browser(); 60 Browser* browser = browser_view->browser();
61 ash::wm::WindowState* window_state = 61 ash::wm::WindowState* window_state =
62 ash::wm::GetWindowState(GetNativeWindow()); 62 ash::wm::GetWindowState(GetNativeWindow());
63 window_state->SetDelegate( 63 window_state->SetDelegate(
64 scoped_ptr<ash::wm::WindowStateDelegate>( 64 scoped_ptr<ash::wm::WindowStateDelegate>(
65 new BrowserWindowStateDelegate(browser)).Pass()); 65 new BrowserWindowStateDelegate(browser)).Pass());
66 window_state->set_animate_to_fullscreen(!browser->is_type_tabbed());
67 66
68 // Turn on auto window management if we don't need an explicit bounds. 67 // Turn on auto window management if we don't need an explicit bounds.
69 // This way the requested bounds are honored. 68 // This way the requested bounds are honored.
70 if (!browser->bounds_overridden() && !browser->is_session_restore()) 69 if (!browser->bounds_overridden() && !browser->is_session_restore())
71 SetWindowAutoManaged(); 70 SetWindowAutoManaged();
72 #if defined(OS_CHROMEOS) 71 #if defined(OS_CHROMEOS)
72 if (browser->is_type_tabbed()) {
73 // Animating to immersive fullscreen does not look good. Immersive
74 // fullscreen is the default fullscreen type on ChromeOS for tabbed browser
75 // windows. The WindowState constructor disables animating to fullscreen
76 // completely when the kAshEnableImmersiveFullscreenForAllWindows command
77 // line flag is set.
78 window_state->set_animate_to_fullscreen(false);
79 }
80
73 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys 81 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys
74 // like brightness, volume, etc. Otherwise these keys are handled by the 82 // like brightness, volume, etc. Otherwise these keys are handled by the
75 // Ash window manager. 83 // Ash window manager.
76 window_state->set_can_consume_system_keys(browser->is_app()); 84 window_state->set_can_consume_system_keys(browser->is_app());
77 #endif // defined(OS_CHROMEOS) 85 #endif // defined(OS_CHROMEOS)
78 } 86 }
79 87
80 /////////////////////////////////////////////////////////////////////////////// 88 ///////////////////////////////////////////////////////////////////////////////
81 // BrowserFrameAsh, views::NativeWidgetAura overrides: 89 // BrowserFrameAsh, views::NativeWidgetAura overrides:
82 90
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 /////////////////////////////////////////////////////////////////////////////// 122 ///////////////////////////////////////////////////////////////////////////////
115 // BrowserFrameAsh, private: 123 // BrowserFrameAsh, private:
116 124
117 void BrowserFrameAsh::SetWindowAutoManaged() { 125 void BrowserFrameAsh::SetWindowAutoManaged() {
118 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || 126 if (browser_view_->browser()->type() != Browser::TYPE_POPUP ||
119 browser_view_->browser()->is_app()) { 127 browser_view_->browser()->is_app()) {
120 ash::wm::GetWindowState(GetNativeWindow())-> 128 ash::wm::GetWindowState(GetNativeWindow())->
121 set_window_position_managed(true); 129 set_window_position_managed(true);
122 } 130 }
123 } 131 }
OLDNEW
« no previous file with comments | « ash/wm/window_state.cc ('k') | chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698