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

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: Minor fixes. 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 } 559 }
560 560
561 void BrowserWindowCocoa::ShowInstant(TabContents* preview) { 561 void BrowserWindowCocoa::ShowInstant(TabContents* preview) {
562 [controller_ showInstant:preview->web_contents()]; 562 [controller_ showInstant:preview->web_contents()];
563 } 563 }
564 564
565 void BrowserWindowCocoa::HideInstant() { 565 void BrowserWindowCocoa::HideInstant() {
566 [controller_ hideInstant]; 566 [controller_ hideInstant];
567 } 567 }
568 568
569 void BrowserWindowCocoa::SetInstantPreviewHeight(int value, bool is_percent) {
570 // TODO(jered): Implement.
571 NOTIMPLEMENTED();
572 }
573
569 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { 574 gfx::Rect BrowserWindowCocoa::GetInstantBounds() {
570 // Flip coordinates based on the primary screen. 575 // Flip coordinates based on the primary screen.
571 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 576 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
572 NSRect monitorFrame = [screen frame]; 577 NSRect monitorFrame = [screen frame];
573 NSRect frame = [controller_ instantFrame]; 578 NSRect frame = [controller_ instantFrame];
574 gfx::Rect bounds(NSRectToCGRect(frame)); 579 gfx::Rect bounds(NSRectToCGRect(frame));
575 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); 580 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height());
576 return bounds; 581 return bounds;
577 } 582 }
578 583
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 AvatarMenuBubbleController* menu = 646 AvatarMenuBubbleController* menu =
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 647 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
643 anchoredAt:point]; 648 anchoredAt:point];
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 649 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
645 [menu showWindow:nil]; 650 [menu showWindow:nil];
646 } 651 }
647 652
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 653 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
649 [[controller_ avatarButtonController] showAvatarBubble]; 654 [[controller_ avatarButtonController] showAvatarBubble];
650 } 655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698