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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_ash.cc

Issue 2652043004: Remove persisted docked windows (Closed)
Patch Set: varkha's comments Created 3 years, 10 months 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
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/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
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 Docked Windows 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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/window_sizer/window_sizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698