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

Unified Diff: extensions/browser/app_window/app_window.cc

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: Address comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/app_window/app_window.cc
diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc
index c1959a98c82541c665e543ff7fba235de8b74b5f..b8a00bffc6c44e5a7817dfe909eb1d42ffac3480 100644
--- a/extensions/browser/app_window/app_window.cc
+++ b/extensions/browser/app_window/app_window.cc
@@ -454,17 +454,35 @@ void AppWindow::OnNativeClose() {
}
void AppWindow::OnNativeWindowChanged() {
+ // This may be called during Init before |native_app_window_| is set.
+ if (!native_app_window_)
+ return;
+
+#if defined(OS_MACOSX)
+ // On Mac the user can change the window's fullscreen state. If that has
+ // happened, update AppWindow's internal state.
+ if (native_app_window_->IsFullscreen()) {
+ if (!IsFullscreen())
+ fullscreen_types_ = FULLSCREEN_TYPE_OS;
+ } else {
+ fullscreen_types_ = FULLSCREEN_TYPE_NONE;
+ }
+
+ if (cached_always_on_top_)
+ UpdateNativeAlwaysOnTop(); // Same as in SetNativeWindowFullscreen.
+#endif
+
SaveWindowPosition();
#if defined(OS_WIN)
- if (native_app_window_ && cached_always_on_top_ && !IsFullscreen() &&
+ if (cached_always_on_top_ && !IsFullscreen() &&
!native_app_window_->IsMaximized() &&
!native_app_window_->IsMinimized()) {
UpdateNativeAlwaysOnTop();
}
#endif
- if (app_window_contents_ && native_app_window_)
+ if (app_window_contents_)
app_window_contents_->NativeWindowChanged(native_app_window_.get());
}
@@ -952,10 +970,9 @@ WebContentsModalDialogHost* AppWindow::GetWebContentsModalDialogHost() {
}
void AppWindow::SaveWindowPosition() {
+ DCHECK(native_app_window_);
if (window_key_.empty())
return;
- if (!native_app_window_)
- return;
AppWindowGeometryCache* cache =
AppWindowGeometryCache::Get(browser_context());
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698