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

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

Issue 23707028: Revert 222226 "App windows with ids should remember fullscreen s..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/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;
473 return ui::SHOW_STATE_NORMAL; 471 return ui::SHOW_STATE_NORMAL;
474 } 472 }
475 473
476 gfx::Rect NativeAppWindowCocoa::GetBounds() const { 474 gfx::Rect NativeAppWindowCocoa::GetBounds() const {
477 // Flip coordinates based on the primary screen. 475 // Flip coordinates based on the primary screen.
478 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 476 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
479 NSRect frame = [window() frame]; 477 NSRect frame = [window() frame];
480 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); 478 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
481 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); 479 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
482 return bounds; 480 return bounds;
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 ShellNSWindow* NativeAppWindowCocoa::window() const { 924 ShellNSWindow* NativeAppWindowCocoa::window() const {
927 NSWindow* window = [window_controller_ window]; 925 NSWindow* window = [window_controller_ window];
928 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 926 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
929 return static_cast<ShellNSWindow*>(window); 927 return static_cast<ShellNSWindow*>(window);
930 } 928 }
931 929
932 void NativeAppWindowCocoa::UpdateRestoredBounds() { 930 void NativeAppWindowCocoa::UpdateRestoredBounds() {
933 if (IsRestored(*this)) 931 if (IsRestored(*this))
934 restored_bounds_ = [window() frame]; 932 restored_bounds_ = [window() frame];
935 } 933 }
OLDNEW
« no previous file with comments | « no previous file | trunk/src/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