| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ash::wm::GetWindowState(GetNativeWindow()); | 63 ash::wm::GetWindowState(GetNativeWindow()); |
| 64 window_state->SetDelegate( | 64 window_state->SetDelegate( |
| 65 scoped_ptr<ash::wm::WindowStateDelegate>( | 65 scoped_ptr<ash::wm::WindowStateDelegate>( |
| 66 new BrowserWindowStateDelegate(browser)).Pass()); | 66 new BrowserWindowStateDelegate(browser)).Pass()); |
| 67 | 67 |
| 68 // Turn on auto window management if we don't need an explicit bounds. | 68 // Turn on auto window management if we don't need an explicit bounds. |
| 69 // This way the requested bounds are honored. | 69 // This way the requested bounds are honored. |
| 70 if (!browser->bounds_overridden() && !browser->is_session_restore()) | 70 if (!browser->bounds_overridden() && !browser->is_session_restore()) |
| 71 SetWindowAutoManaged(); | 71 SetWindowAutoManaged(); |
| 72 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
| 73 if (browser->is_type_tabbed()) { | |
| 74 // Animating to immersive fullscreen does not look good. Immersive | |
| 75 // fullscreen is the default fullscreen type on ChromeOS for tabbed browser | |
| 76 // windows. The WindowState constructor disables animating to fullscreen | |
| 77 // completely when switches::UseImmersiveFullscreenForAllWindows() returns | |
| 78 // true. | |
| 79 window_state->set_animate_to_fullscreen(false); | |
| 80 } | |
| 81 | |
| 82 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys | 73 // For legacy reasons v1 apps (like Secure Shell) are allowed to consume keys |
| 83 // like brightness, volume, etc. Otherwise these keys are handled by the | 74 // like brightness, volume, etc. Otherwise these keys are handled by the |
| 84 // Ash window manager. | 75 // Ash window manager. |
| 85 window_state->set_can_consume_system_keys(browser->is_app()); | 76 window_state->set_can_consume_system_keys(browser->is_app()); |
| 86 #endif // defined(OS_CHROMEOS) | 77 #endif // defined(OS_CHROMEOS) |
| 87 } | 78 } |
| 88 | 79 |
| 89 /////////////////////////////////////////////////////////////////////////////// | 80 /////////////////////////////////////////////////////////////////////////////// |
| 90 // BrowserFrameAsh, views::NativeWidgetAura overrides: | 81 // BrowserFrameAsh, views::NativeWidgetAura overrides: |
| 91 | 82 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 /////////////////////////////////////////////////////////////////////////////// | 122 /////////////////////////////////////////////////////////////////////////////// |
| 132 // BrowserFrameAsh, private: | 123 // BrowserFrameAsh, private: |
| 133 | 124 |
| 134 void BrowserFrameAsh::SetWindowAutoManaged() { | 125 void BrowserFrameAsh::SetWindowAutoManaged() { |
| 135 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || | 126 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || |
| 136 browser_view_->browser()->is_app()) { | 127 browser_view_->browser()->is_app()) { |
| 137 ash::wm::GetWindowState(GetNativeWindow())-> | 128 ash::wm::GetWindowState(GetNativeWindow())-> |
| 138 set_window_position_managed(true); | 129 set_window_position_managed(true); |
| 139 } | 130 } |
| 140 } | 131 } |
| OLD | NEW |