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

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

Issue 8110003: Show avatar menu from NTP4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 NSWindow* BrowserWindowCocoa::window() const { 569 NSWindow* BrowserWindowCocoa::window() const {
570 return [controller_ window]; 570 return [controller_ window];
571 } 571 }
572 572
573 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { 573 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) {
574 if (tab_contents == browser_->GetSelectedTabContents()) { 574 if (tab_contents == browser_->GetSelectedTabContents()) {
575 [controller_ updateSidebarForContents:tab_contents]; 575 [controller_ updateSidebarForContents:tab_contents];
576 } 576 }
577 } 577 }
578
579 void BrowserWindowCocoa::ShowAvatarBubble(TabContents* tab_contents,
580 int x, int y) {
581 NSView* view = tab_contents->GetNativeView();
582 NSPoint point = NSMakePoint(x, y);
583 point = [view convertPoint:point toView:nil];
584 point = [[view window] convertBaseToScreen:point];
585
586 // |menu| will automatically release itself on close.
587 AvatarMenuBubbleController* menu =
588 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
589 anchoredAt:point];
590 [menu showWindow:nil];
591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698