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

Side by Side Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 23672029: App windows with ids should remember fullscreen state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/apps/native_app_window_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cocoa/apps/native_app_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h"
6 6
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" 7 #include "apps/app_shim/extension_app_shim_handler_mac.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 461 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
462 NSRect frame = restored_bounds_; 462 NSRect frame = restored_bounds_;
463 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); 463 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
464 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); 464 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
465 return bounds; 465 return bounds;
466 } 466 }
467 467
468 ui::WindowShowState NativeAppWindowCocoa::GetRestoredState() const { 468 ui::WindowShowState NativeAppWindowCocoa::GetRestoredState() const {
469 if (IsMaximized()) 469 if (IsMaximized())
470 return ui::SHOW_STATE_MAXIMIZED; 470 return ui::SHOW_STATE_MAXIMIZED;
471 if (IsFullscreen())
472 return ui::SHOW_STATE_FULLSCREEN;
471 return ui::SHOW_STATE_NORMAL; 473 return ui::SHOW_STATE_NORMAL;
472 } 474 }
473 475
474 gfx::Rect NativeAppWindowCocoa::GetBounds() const { 476 gfx::Rect NativeAppWindowCocoa::GetBounds() const {
475 // Flip coordinates based on the primary screen. 477 // Flip coordinates based on the primary screen.
476 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 478 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
477 NSRect frame = [window() frame]; 479 NSRect frame = [window() frame];
478 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); 480 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
479 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); 481 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
480 return bounds; 482 return bounds;
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 ShellNSWindow* NativeAppWindowCocoa::window() const { 921 ShellNSWindow* NativeAppWindowCocoa::window() const {
920 NSWindow* window = [window_controller_ window]; 922 NSWindow* window = [window_controller_ window];
921 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 923 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
922 return static_cast<ShellNSWindow*>(window); 924 return static_cast<ShellNSWindow*>(window);
923 } 925 }
924 926
925 void NativeAppWindowCocoa::UpdateRestoredBounds() { 927 void NativeAppWindowCocoa::UpdateRestoredBounds() {
926 if (IsRestored(*this)) 928 if (IsRestored(*this))
927 restored_bounds_ = [window() frame]; 929 restored_bounds_ = [window() frame];
928 } 930 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/apps/native_app_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698