OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |