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

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, 1 month 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()); 66
67 #if defined(OS_CHROMEOS)
James Cook 2013/11/25 19:09:20 nit: Can this move into the OS_CHROMEOS block belo
68 if (browser->is_type_tabbed()) {
69 // Animating to immersive fullscreen does not look good. Immersive
70 // fullscreen is the default fullscreen type on ChromeOS for tabbed browser
71 // windows. The WindowState constructor disables animating to fullscreen
72 // completely when the kAshEnableImmersiveFullscreenForAllWindows command
73 // line flag is set.
74 window_state->set_animate_to_fullscreen(false);
75 }
76 #endif
67 77
68 // Turn on auto window management if we don't need an explicit bounds. 78 // Turn on auto window management if we don't need an explicit bounds.
69 // This way the requested bounds are honored. 79 // This way the requested bounds are honored.
70 if (!browser->bounds_overridden() && !browser->is_session_restore()) 80 if (!browser->bounds_overridden() && !browser->is_session_restore())
71 SetWindowAutoManaged(); 81 SetWindowAutoManaged();
72 #if defined(OS_CHROMEOS) 82 #if defined(OS_CHROMEOS)
73 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys 83 // 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 84 // like brightness, volume, etc. Otherwise these keys are handled by the
75 // Ash window manager. 85 // Ash window manager.
76 window_state->set_can_consume_system_keys(browser->is_app()); 86 window_state->set_can_consume_system_keys(browser->is_app());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 /////////////////////////////////////////////////////////////////////////////// 124 ///////////////////////////////////////////////////////////////////////////////
115 // BrowserFrameAsh, private: 125 // BrowserFrameAsh, private:
116 126
117 void BrowserFrameAsh::SetWindowAutoManaged() { 127 void BrowserFrameAsh::SetWindowAutoManaged() {
118 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || 128 if (browser_view_->browser()->type() != Browser::TYPE_POPUP ||
119 browser_view_->browser()->is_app()) { 129 browser_view_->browser()->is_app()) {
120 ash::wm::GetWindowState(GetNativeWindow())-> 130 ash::wm::GetWindowState(GetNativeWindow())->
121 set_window_position_managed(true); 131 set_window_position_managed(true);
122 } 132 }
123 } 133 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698