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/ash_switches.h" |
8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
9 #include "ash/common/wm/window_state_delegate.h" | 9 #include "ash/common/wm/window_state_delegate.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } else { | 111 } else { |
112 *bounds = GetWidget()->GetRestoredBounds(); | 112 *bounds = GetWidget()->GetRestoredBounds(); |
113 *show_state = GetWidget()->GetNativeWindow()->GetProperty( | 113 *show_state = GetWidget()->GetNativeWindow()->GetProperty( |
114 aura::client::kShowStateKey); | 114 aura::client::kShowStateKey); |
115 } | 115 } |
116 | 116 |
117 if (*show_state != ui::SHOW_STATE_MAXIMIZED && | 117 if (*show_state != ui::SHOW_STATE_MAXIMIZED && |
118 *show_state != ui::SHOW_STATE_MINIMIZED) { | 118 *show_state != ui::SHOW_STATE_MINIMIZED) { |
119 *show_state = ui::SHOW_STATE_NORMAL; | 119 *show_state = ui::SHOW_STATE_NORMAL; |
120 } | 120 } |
121 | |
122 // TODO(afakhry): Remove Docked Windows in M58. | |
123 if (ash::switches::DockedWindowsEnabled() && | |
124 ash::wm::GetWindowState(GetNativeWindow())->IsDocked()) { | |
125 if (browser_view_->browser()->is_app()) { | |
126 // Only web app windows (not tabbed browser windows) persist docked state. | |
127 *show_state = ui::SHOW_STATE_DOCKED; | |
128 } else { | |
129 // Restore original restore bounds for tabbed browser windows ignoring | |
130 // the docked origin. | |
131 gfx::Rect* restore_bounds = GetWidget()->GetNativeWindow()->GetProperty( | |
132 aura::client::kRestoreBoundsKey); | |
133 if (restore_bounds) | |
134 *bounds = *restore_bounds; | |
135 } | |
136 } | |
137 } | 121 } |
138 | 122 |
139 bool BrowserFrameAsh::PreHandleKeyboardEvent( | 123 bool BrowserFrameAsh::PreHandleKeyboardEvent( |
140 const content::NativeWebKeyboardEvent& event) { | 124 const content::NativeWebKeyboardEvent& event) { |
141 return false; | 125 return false; |
142 } | 126 } |
143 | 127 |
144 bool BrowserFrameAsh::HandleKeyboardEvent( | 128 bool BrowserFrameAsh::HandleKeyboardEvent( |
145 const content::NativeWebKeyboardEvent& event) { | 129 const content::NativeWebKeyboardEvent& event) { |
146 return false; | 130 return false; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // BrowserFrameAsh, private: | 162 // BrowserFrameAsh, private: |
179 | 163 |
180 void BrowserFrameAsh::SetWindowAutoManaged() { | 164 void BrowserFrameAsh::SetWindowAutoManaged() { |
181 // For browser window in Chrome OS, we should only enable the auto window | 165 // For browser window in Chrome OS, we should only enable the auto window |
182 // management logic for tabbed browser. | 166 // management logic for tabbed browser. |
183 if (!browser_view_->browser()->is_type_popup()) { | 167 if (!browser_view_->browser()->is_type_popup()) { |
184 ash::wm::GetWindowState(GetNativeWindow()) | 168 ash::wm::GetWindowState(GetNativeWindow()) |
185 ->set_window_position_managed(true); | 169 ->set_window_position_managed(true); |
186 } | 170 } |
187 } | 171 } |
OLD | NEW |