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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 FindBar* BrowserWindowCocoa::CreateFindBar() { | 591 FindBar* BrowserWindowCocoa::CreateFindBar() { |
592 // We could push the AddFindBar() call into the FindBarBridge | 592 // We could push the AddFindBar() call into the FindBarBridge |
593 // constructor or the FindBarCocoaController init, but that makes | 593 // constructor or the FindBarCocoaController init, but that makes |
594 // unit testing difficult, since we would also require a | 594 // unit testing difficult, since we would also require a |
595 // BrowserWindow object. | 595 // BrowserWindow object. |
596 FindBarBridge* bridge = new FindBarBridge(); | 596 FindBarBridge* bridge = new FindBarBridge(); |
597 AddFindBar(bridge->find_bar_cocoa_controller()); | 597 AddFindBar(bridge->find_bar_cocoa_controller()); |
598 return bridge; | 598 return bridge; |
599 } | 599 } |
600 | 600 |
| 601 int BrowserWindowCocoa::GetConstrainedWindowTopY() { |
| 602 return -1; |
| 603 } |
| 604 |
601 void BrowserWindowCocoa::Observe(int type, | 605 void BrowserWindowCocoa::Observe(int type, |
602 const content::NotificationSource& source, | 606 const content::NotificationSource& source, |
603 const content::NotificationDetails& details) { | 607 const content::NotificationDetails& details) { |
604 switch (type) { | 608 switch (type) { |
605 case chrome::NOTIFICATION_PREF_CHANGED: { | 609 case chrome::NOTIFICATION_PREF_CHANGED: { |
606 const std::string& pref_name = | 610 const std::string& pref_name = |
607 *content::Details<std::string>(details).ptr(); | 611 *content::Details<std::string>(details).ptr(); |
608 DCHECK(pref_name == prefs::kShowBookmarkBar); | 612 DCHECK(pref_name == prefs::kShowBookmarkBar); |
609 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; | 613 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; |
610 break; | 614 break; |
(...skipping 30 matching lines...) Expand all Loading... |
641 AvatarMenuBubbleController* menu = | 645 AvatarMenuBubbleController* menu = |
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 646 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
643 anchoredAt:point]; | 647 anchoredAt:point]; |
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 648 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
645 [menu showWindow:nil]; | 649 [menu showWindow:nil]; |
646 } | 650 } |
647 | 651 |
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 652 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
649 [[controller_ avatarButtonController] showAvatarBubble]; | 653 [[controller_ avatarButtonController] showAvatarBubble]; |
650 } | 654 } |
OLD | NEW |