| 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/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 Loading... |
| 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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 gfx::Rect client_bounds = gfx::Rect(1000, 1000); | 1052 gfx::Rect client_bounds = gfx::Rect(1000, 1000); |
| 1053 gfx::Rect window_bounds = | 1053 gfx::Rect window_bounds = |
| 1054 window_->non_client_view()->GetWindowBoundsForClientBounds( | 1054 window_->non_client_view()->GetWindowBoundsForClientBounds( |
| 1055 client_bounds); | 1055 client_bounds); |
| 1056 return window_bounds.InsetsFrom(client_bounds); | 1056 return window_bounds.InsetsFrom(client_bounds); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 void NativeAppWindowViews::HideWithApp() {} | 1059 void NativeAppWindowViews::HideWithApp() {} |
| 1060 void NativeAppWindowViews::ShowWithApp() {} | 1060 void NativeAppWindowViews::ShowWithApp() {} |
| 1061 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} | 1061 void NativeAppWindowViews::UpdateWindowMinMaxSize() {} |
| OLD | NEW |