| 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/common/ash_switches.h" |
| 7 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 8 #include "ash/common/wm/window_state_delegate.h" | 9 #include "ash/common/wm/window_state_delegate.h" |
| 9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 10 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
| 11 #include "ash/wm/window_state_aura.h" | 12 #include "ash/wm/window_state_aura.h" |
| 12 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 *bounds = GetWidget()->GetRestoredBounds(); | 112 *bounds = GetWidget()->GetRestoredBounds(); |
| 112 *show_state = GetWidget()->GetNativeWindow()->GetProperty( | 113 *show_state = GetWidget()->GetNativeWindow()->GetProperty( |
| 113 aura::client::kShowStateKey); | 114 aura::client::kShowStateKey); |
| 114 } | 115 } |
| 115 | 116 |
| 116 if (*show_state != ui::SHOW_STATE_MAXIMIZED && | 117 if (*show_state != ui::SHOW_STATE_MAXIMIZED && |
| 117 *show_state != ui::SHOW_STATE_MINIMIZED) { | 118 *show_state != ui::SHOW_STATE_MINIMIZED) { |
| 118 *show_state = ui::SHOW_STATE_NORMAL; | 119 *show_state = ui::SHOW_STATE_NORMAL; |
| 119 } | 120 } |
| 120 | 121 |
| 121 if (ash::wm::GetWindowState(GetNativeWindow())->IsDocked()) { | 122 // TODO(afakhry): Remove in M58. |
| 123 if (ash::switches::DockedWindowsEnabled() && |
| 124 ash::wm::GetWindowState(GetNativeWindow())->IsDocked()) { |
| 122 if (browser_view_->browser()->is_app()) { | 125 if (browser_view_->browser()->is_app()) { |
| 123 // Only web app windows (not tabbed browser windows) persist docked state. | 126 // Only web app windows (not tabbed browser windows) persist docked state. |
| 124 *show_state = ui::SHOW_STATE_DOCKED; | 127 *show_state = ui::SHOW_STATE_DOCKED; |
| 125 } else { | 128 } else { |
| 126 // Restore original restore bounds for tabbed browser windows ignoring | 129 // Restore original restore bounds for tabbed browser windows ignoring |
| 127 // the docked origin. | 130 // the docked origin. |
| 128 gfx::Rect* restore_bounds = GetWidget()->GetNativeWindow()->GetProperty( | 131 gfx::Rect* restore_bounds = GetWidget()->GetNativeWindow()->GetProperty( |
| 129 aura::client::kRestoreBoundsKey); | 132 aura::client::kRestoreBoundsKey); |
| 130 if (restore_bounds) | 133 if (restore_bounds) |
| 131 *bounds = *restore_bounds; | 134 *bounds = *restore_bounds; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 /////////////////////////////////////////////////////////////////////////////// | 177 /////////////////////////////////////////////////////////////////////////////// |
| 175 // BrowserFrameAsh, private: | 178 // BrowserFrameAsh, private: |
| 176 | 179 |
| 177 void BrowserFrameAsh::SetWindowAutoManaged() { | 180 void BrowserFrameAsh::SetWindowAutoManaged() { |
| 178 if (!browser_view_->browser()->is_type_popup() || | 181 if (!browser_view_->browser()->is_type_popup() || |
| 179 browser_view_->browser()->is_app()) { | 182 browser_view_->browser()->is_app()) { |
| 180 ash::wm::GetWindowState(GetNativeWindow())-> | 183 ash::wm::GetWindowState(GetNativeWindow())-> |
| 181 set_window_position_managed(true); | 184 set_window_position_managed(true); |
| 182 } | 185 } |
| 183 } | 186 } |
| OLD | NEW |