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

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

Issue 10915217: Hook up SetInstantPreviewHeight for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments. 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 void BrowserWindowCocoa::SetInstantPreviewHeight(int height,
580 InstantSizeUnits units) {
581 // TODO(jered): Implement.
582 NOTIMPLEMENTED();
583 }
584
579 bool BrowserWindowCocoa::IsInstantTabShowing() { 585 bool BrowserWindowCocoa::IsInstantTabShowing() {
580 return [controller_ isInstantTabShowing]; 586 return [controller_ isInstantTabShowing];
581 } 587 }
582 588
583 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds( 589 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds(
584 const gfx::Rect& bounds) { 590 const gfx::Rect& bounds) {
585 // In Lion fullscreen mode, convert popups into tabs. 591 // In Lion fullscreen mode, convert popups into tabs.
586 if (base::mac::IsOSLionOrLater() && IsFullscreen()) 592 if (base::mac::IsOSLionOrLater() && IsFullscreen())
587 return NEW_FOREGROUND_TAB; 593 return NEW_FOREGROUND_TAB;
588 return NEW_POPUP; 594 return NEW_POPUP;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 AvatarMenuBubbleController* menu = 647 AvatarMenuBubbleController* menu =
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 648 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
643 anchoredAt:point]; 649 anchoredAt:point];
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 650 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
645 [menu showWindow:nil]; 651 [menu showWindow:nil];
646 } 652 }
647 653
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 654 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
649 [[controller_ avatarButtonController] showAvatarBubble]; 655 [[controller_ avatarButtonController] showAvatarBubble];
650 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698