| OLD | NEW |
| 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 FindBar* BrowserWindowCocoa::CreateFindBar() { | 596 FindBar* BrowserWindowCocoa::CreateFindBar() { |
| 597 // We could push the AddFindBar() call into the FindBarBridge | 597 // We could push the AddFindBar() call into the FindBarBridge |
| 598 // constructor or the FindBarCocoaController init, but that makes | 598 // constructor or the FindBarCocoaController init, but that makes |
| 599 // unit testing difficult, since we would also require a | 599 // unit testing difficult, since we would also require a |
| 600 // BrowserWindow object. | 600 // BrowserWindow object. |
| 601 FindBarBridge* bridge = new FindBarBridge(); | 601 FindBarBridge* bridge = new FindBarBridge(); |
| 602 AddFindBar(bridge->find_bar_cocoa_controller()); | 602 AddFindBar(bridge->find_bar_cocoa_controller()); |
| 603 return bridge; | 603 return bridge; |
| 604 } | 604 } |
| 605 | 605 |
| 606 int BrowserWindowCocoa::GetConstrainedWindowTopY() { |
| 607 return -1; |
| 608 } |
| 609 |
| 606 void BrowserWindowCocoa::Observe(int type, | 610 void BrowserWindowCocoa::Observe(int type, |
| 607 const content::NotificationSource& source, | 611 const content::NotificationSource& source, |
| 608 const content::NotificationDetails& details) { | 612 const content::NotificationDetails& details) { |
| 609 switch (type) { | 613 switch (type) { |
| 610 case chrome::NOTIFICATION_PREF_CHANGED: { | 614 case chrome::NOTIFICATION_PREF_CHANGED: { |
| 611 const std::string& pref_name = | 615 const std::string& pref_name = |
| 612 *content::Details<std::string>(details).ptr(); | 616 *content::Details<std::string>(details).ptr(); |
| 613 DCHECK(pref_name == prefs::kShowBookmarkBar); | 617 DCHECK(pref_name == prefs::kShowBookmarkBar); |
| 614 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; | 618 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; |
| 615 break; | 619 break; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 AvatarMenuBubbleController* menu = | 661 AvatarMenuBubbleController* menu = |
| 658 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 662 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
| 659 anchoredAt:point]; | 663 anchoredAt:point]; |
| 660 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 664 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
| 661 [menu showWindow:nil]; | 665 [menu showWindow:nil]; |
| 662 } | 666 } |
| 663 | 667 |
| 664 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 668 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
| 665 [[controller_ avatarButtonController] showAvatarBubble]; | 669 [[controller_ avatarButtonController] showAvatarBubble]; |
| 666 } | 670 } |
| OLD | NEW |