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

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

Issue 8298005: Fixes bug in instant where we would end up incorrectly using the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweak Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 bool BrowserWindowCocoa::InPresentationMode() { 509 bool BrowserWindowCocoa::InPresentationMode() {
510 return [controller_ inPresentationMode]; 510 return [controller_ inPresentationMode];
511 } 511 }
512 512
513 void BrowserWindowCocoa::ShowInstant(TabContentsWrapper* preview) { 513 void BrowserWindowCocoa::ShowInstant(TabContentsWrapper* preview) {
514 [controller_ showInstant:preview->tab_contents()]; 514 [controller_ showInstant:preview->tab_contents()];
515 } 515 }
516 516
517 void BrowserWindowCocoa::HideInstant(bool instant_is_active) { 517 void BrowserWindowCocoa::HideInstant() {
518 [controller_ hideInstant]; 518 [controller_ hideInstant];
519
520 // TODO: add support for |instant_is_active|.
521 } 519 }
522 520
523 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { 521 gfx::Rect BrowserWindowCocoa::GetInstantBounds() {
524 // Flip coordinates based on the primary screen. 522 // Flip coordinates based on the primary screen.
525 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 523 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
526 NSRect monitorFrame = [screen frame]; 524 NSRect monitorFrame = [screen frame];
527 NSRect frame = [controller_ instantFrame]; 525 NSRect frame = [controller_ instantFrame];
528 gfx::Rect bounds(NSRectToCGRect(frame)); 526 gfx::Rect bounds(NSRectToCGRect(frame));
529 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); 527 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height());
530 return bounds; 528 return bounds;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 point.y = NSMaxY(bounds) - rect.bottom(); 590 point.y = NSMaxY(bounds) - rect.bottom();
593 point = [view convertPoint:point toView:nil]; 591 point = [view convertPoint:point toView:nil];
594 point = [[view window] convertBaseToScreen:point]; 592 point = [[view window] convertBaseToScreen:point];
595 593
596 // |menu| will automatically release itself on close. 594 // |menu| will automatically release itself on close.
597 AvatarMenuBubbleController* menu = 595 AvatarMenuBubbleController* menu =
598 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 596 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
599 anchoredAt:point]; 597 anchoredAt:point];
600 [menu showWindow:nil]; 598 [menu showWindow:nil];
601 } 599 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/gtk/browser_window_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698