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

Side by Side Diff: chrome/browser/ui/views/apps/native_app_window_views.cc

Issue 149303003: [Refactor] Move the logic to update bounds for show type from WorkspaceLayoutManager to DefaultState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle show_inactive Created 6 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 | Annotate | Revision Log
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/apps/native_app_window_views.h" 5 #include "chrome/browser/ui/views/apps/native_app_window_views.h"
6 6
7 #include "apps/shell_window.h" 7 #include "apps/shell_window.h"
8 #include "apps/ui/views/shell_window_frame_view.h" 8 #include "apps/ui/views/shell_window_frame_view.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // Windows which cannot be maximized should not be fullscreened. 204 // Windows which cannot be maximized should not be fullscreened.
205 DCHECK(window_state->IsFullscreen() || window_state->CanMaximize()); 205 DCHECK(window_state->IsFullscreen() || window_state->CanMaximize());
206 if (window_state->IsFullscreen()) 206 if (window_state->IsFullscreen())
207 shell_window_->Restore(); 207 shell_window_->Restore();
208 else if (window_state->CanMaximize()) 208 else if (window_state->CanMaximize())
209 shell_window_->OSFullscreen(); 209 shell_window_->OSFullscreen();
210 return true; 210 return true;
211 } 211 }
212 212
213 // Overridden from ash::wm::WindowStateObserver: 213 // Overridden from ash::wm::WindowStateObserver:
214 virtual void OnWindowShowTypeChanged( 214 virtual void OnPostWindowShowTypeChange(
215 ash::wm::WindowState* window_state, 215 ash::wm::WindowState* window_state,
216 ash::wm::WindowShowType old_type) OVERRIDE { 216 ash::wm::WindowShowType old_type) OVERRIDE {
217 if (!window_state->IsFullscreen() && 217 if (!window_state->IsFullscreen() &&
218 !window_state->IsMinimized() && 218 !window_state->IsMinimized() &&
219 shell_window_->GetBaseWindow()->IsFullscreenOrPending()) { 219 shell_window_->GetBaseWindow()->IsFullscreenOrPending()) {
220 shell_window_->Restore(); 220 shell_window_->Restore();
221 // Usually OnNativeWindowChanged() is called when the window bounds are 221 // Usually OnNativeWindowChanged() is called when the window bounds are
222 // changed as a result of a show type change. Because the change in show 222 // changed as a result of a show type change. Because the change in show
223 // type has already occurred, we need to call OnNativeWindowChanged() 223 // type has already occurred, we need to call OnNativeWindowChanged()
224 // explicitly. 224 // explicitly.
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 gfx::Rect client_bounds = gfx::Rect(1000, 1000); 1055 gfx::Rect client_bounds = gfx::Rect(1000, 1000);
1056 gfx::Rect window_bounds = 1056 gfx::Rect window_bounds =
1057 window_->non_client_view()->GetWindowBoundsForClientBounds( 1057 window_->non_client_view()->GetWindowBoundsForClientBounds(
1058 client_bounds); 1058 client_bounds);
1059 return window_bounds.InsetsFrom(client_bounds); 1059 return window_bounds.InsetsFrom(client_bounds);
1060 } 1060 }
1061 1061
1062 void NativeAppWindowViews::HideWithApp() {} 1062 void NativeAppWindowViews::HideWithApp() {}
1063 void NativeAppWindowViews::ShowWithApp() {} 1063 void NativeAppWindowViews::ShowWithApp() {}
1064 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} 1064 void NativeAppWindowViews::UpdateWindowMinMaxSize() {}
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager_unittest.cc ('k') | chrome/browser/ui/views/frame/immersive_mode_controller_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698