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

Side by Side Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 1172483003: [MacViews] Update AppWindow when the native window changes fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views
Patch Set: Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 // If going into fullscreen, store an answer for GetRestoredBounds(). 405 // If going into fullscreen, store an answer for GetRestoredBounds().
406 if (target_fullscreen_state) 406 if (target_fullscreen_state)
407 bounds_before_fullscreen_ = gfx::ScreenRectFromNSRect([window_ frame]); 407 bounds_before_fullscreen_ = gfx::ScreenRectFromNSRect([window_ frame]);
408 } 408 }
409 409
410 void BridgedNativeWidget::OnFullscreenTransitionComplete( 410 void BridgedNativeWidget::OnFullscreenTransitionComplete(
411 bool actual_fullscreen_state) { 411 bool actual_fullscreen_state) {
412 in_fullscreen_transition_ = false; 412 in_fullscreen_transition_ = false;
413 413
414 if (target_fullscreen_state_ == actual_fullscreen_state) { 414 if (target_fullscreen_state_ == actual_fullscreen_state) {
415 native_widget_mac_->OnFullscreenTransitionComplete(actual_fullscreen_state);
415 // Ensure constraints are re-applied when completing a transition. 416 // Ensure constraints are re-applied when completing a transition.
416 OnSizeConstraintsChanged(); 417 OnSizeConstraintsChanged();
417 return; 418 return;
418 } 419 }
419 420
420 // First update to reflect reality so that OnTargetFullscreenStateChanged() 421 // First update to reflect reality so that OnTargetFullscreenStateChanged()
421 // expects the change. 422 // expects the change.
422 target_fullscreen_state_ = actual_fullscreen_state; 423 target_fullscreen_state_ = actual_fullscreen_state;
423 ToggleDesiredFullscreenState(); 424 ToggleDesiredFullscreenState();
424 425
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 window_, &kWindowPropertiesKey); 881 window_, &kWindowPropertiesKey);
881 if (!properties) { 882 if (!properties) {
882 properties = [NSMutableDictionary dictionary]; 883 properties = [NSMutableDictionary dictionary];
883 objc_setAssociatedObject(window_, &kWindowPropertiesKey, 884 objc_setAssociatedObject(window_, &kWindowPropertiesKey,
884 properties, OBJC_ASSOCIATION_RETAIN); 885 properties, OBJC_ASSOCIATION_RETAIN);
885 } 886 }
886 return properties; 887 return properties;
887 } 888 }
888 889
889 } // namespace views 890 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698