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

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

Issue 1221193009: [Docking] Persists docked state for tab-less browser windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Docking] Persists docked state for tab-less browser windows (nits) Created 5 years, 5 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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/views/frame/browser_view_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698