| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/window_properties.h" | 8 #include "ash/wm/window_properties.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "ash/wm/window_state_delegate.h" | 10 #include "ash/wm/window_state_delegate.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } else { | 114 } else { |
| 115 *bounds = GetWidget()->GetRestoredBounds(); | 115 *bounds = GetWidget()->GetRestoredBounds(); |
| 116 *show_state = GetWidget()->GetNativeWindow()->GetProperty( | 116 *show_state = GetWidget()->GetNativeWindow()->GetProperty( |
| 117 aura::client::kShowStateKey); | 117 aura::client::kShowStateKey); |
| 118 } | 118 } |
| 119 | 119 |
| 120 if (*show_state != ui::SHOW_STATE_MAXIMIZED && | 120 if (*show_state != ui::SHOW_STATE_MAXIMIZED && |
| 121 *show_state != ui::SHOW_STATE_MINIMIZED) { | 121 *show_state != ui::SHOW_STATE_MINIMIZED) { |
| 122 *show_state = ui::SHOW_STATE_NORMAL; | 122 *show_state = ui::SHOW_STATE_NORMAL; |
| 123 } | 123 } |
| 124 |
| 125 if (ash::wm::GetWindowState(GetNativeWindow())->IsDocked()) { |
| 126 if (browser_view_->browser()->is_app()) { |
| 127 // Only web app windows (not tabbed browser windows) persist docked state. |
| 128 *show_state = ui::SHOW_STATE_DOCKED; |
| 129 } else { |
| 130 // Restore original restore bounds for tabbed browser windows ignoring |
| 131 // the docked origin. |
| 132 gfx::Rect* restore_bounds = GetWidget()->GetNativeWindow()->GetProperty( |
| 133 aura::client::kRestoreBoundsKey); |
| 134 if (restore_bounds) |
| 135 *bounds = *restore_bounds; |
| 136 } |
| 137 } |
| 124 } | 138 } |
| 125 | 139 |
| 126 //////////////////////////////////////////////////////////////////////////////// | 140 //////////////////////////////////////////////////////////////////////////////// |
| 127 // BrowserFrameAsh, NativeBrowserFrame implementation: | 141 // BrowserFrameAsh, NativeBrowserFrame implementation: |
| 128 | 142 |
| 129 views::Widget::InitParams BrowserFrameAsh::GetWidgetParams() { | 143 views::Widget::InitParams BrowserFrameAsh::GetWidgetParams() { |
| 130 views::Widget::InitParams params; | 144 views::Widget::InitParams params; |
| 131 params.native_widget = this; | 145 params.native_widget = this; |
| 132 | 146 |
| 133 params.context = ash::Shell::GetPrimaryRootWindow(); | 147 params.context = ash::Shell::GetPrimaryRootWindow(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 157 /////////////////////////////////////////////////////////////////////////////// | 171 /////////////////////////////////////////////////////////////////////////////// |
| 158 // BrowserFrameAsh, private: | 172 // BrowserFrameAsh, private: |
| 159 | 173 |
| 160 void BrowserFrameAsh::SetWindowAutoManaged() { | 174 void BrowserFrameAsh::SetWindowAutoManaged() { |
| 161 if (!browser_view_->browser()->is_type_popup() || | 175 if (!browser_view_->browser()->is_type_popup() || |
| 162 browser_view_->browser()->is_app()) { | 176 browser_view_->browser()->is_app()) { |
| 163 ash::wm::GetWindowState(GetNativeWindow())-> | 177 ash::wm::GetWindowState(GetNativeWindow())-> |
| 164 set_window_position_managed(true); | 178 set_window_position_managed(true); |
| 165 } | 179 } |
| 166 } | 180 } |
| OLD | NEW |