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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { 569 gfx::Rect BrowserWindowCocoa::GetInstantBounds() {
570 // Flip coordinates based on the primary screen. 570 // Flip coordinates based on the primary screen.
571 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 571 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
572 NSRect monitorFrame = [screen frame]; 572 NSRect monitorFrame = [screen frame];
573 NSRect frame = [controller_ instantFrame]; 573 NSRect frame = [controller_ instantFrame];
574 gfx::Rect bounds(NSRectToCGRect(frame)); 574 gfx::Rect bounds(NSRectToCGRect(frame));
575 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); 575 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height());
576 return bounds; 576 return bounds;
577 } 577 }
578 578
579 bool BrowserWindowCocoa::GetIsShowingInstant() {
580 return [controller_ isShowingInstant];
581 }
582
579 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds( 583 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds(
580 const gfx::Rect& bounds) { 584 const gfx::Rect& bounds) {
581 // In Lion fullscreen mode, convert popups into tabs. 585 // In Lion fullscreen mode, convert popups into tabs.
582 if (base::mac::IsOSLionOrLater() && IsFullscreen()) 586 if (base::mac::IsOSLionOrLater() && IsFullscreen())
583 return NEW_FOREGROUND_TAB; 587 return NEW_FOREGROUND_TAB;
584 return NEW_POPUP; 588 return NEW_POPUP;
585 } 589 }
586 590
587 FindBar* BrowserWindowCocoa::CreateFindBar() { 591 FindBar* BrowserWindowCocoa::CreateFindBar() {
588 // We could push the AddFindBar() call into the FindBarBridge 592 // We could push the AddFindBar() call into the FindBarBridge
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 AvatarMenuBubbleController* menu = 641 AvatarMenuBubbleController* menu =
638 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
639 anchoredAt:point]; 643 anchoredAt:point];
640 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
641 [menu showWindow:nil]; 645 [menu showWindow:nil];
642 } 646 }
643 647
644 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
645 [[controller_ avatarButtonController] showAvatarBubble]; 649 [[controller_ avatarButtonController] showAvatarBubble];
646 } 650 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698