| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { | 560 gfx::Rect BrowserWindowCocoa::GetInstantBounds() { |
| 561 // Flip coordinates based on the primary screen. | 561 // Flip coordinates based on the primary screen. |
| 562 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 562 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| 563 NSRect monitorFrame = [screen frame]; | 563 NSRect monitorFrame = [screen frame]; |
| 564 NSRect frame = [controller_ instantFrame]; | 564 NSRect frame = [controller_ instantFrame]; |
| 565 gfx::Rect bounds(NSRectToCGRect(frame)); | 565 gfx::Rect bounds(NSRectToCGRect(frame)); |
| 566 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); | 566 bounds.set_y(NSHeight(monitorFrame) - bounds.y() - bounds.height()); |
| 567 return bounds; | 567 return bounds; |
| 568 } | 568 } |
| 569 | 569 |
| 570 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds( |
| 571 const gfx::Rect& bounds) { |
| 572 return NEW_POPUP; |
| 573 } |
| 574 |
| 570 void BrowserWindowCocoa::Observe(NotificationType type, | 575 void BrowserWindowCocoa::Observe(NotificationType type, |
| 571 const NotificationSource& source, | 576 const NotificationSource& source, |
| 572 const NotificationDetails& details) { | 577 const NotificationDetails& details) { |
| 573 switch (type.value) { | 578 switch (type.value) { |
| 574 // Only the key window gets a direct toggle from the menu. | 579 // Only the key window gets a direct toggle from the menu. |
| 575 // Other windows hear about it from the notification. | 580 // Other windows hear about it from the notification. |
| 576 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: | 581 case NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: |
| 577 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; | 582 [controller_ updateBookmarkBarVisibilityWithAnimation:YES]; |
| 578 break; | 583 break; |
| 579 case NotificationType::SIDEBAR_CHANGED: | 584 case NotificationType::SIDEBAR_CHANGED: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 595 | 600 |
| 596 NSWindow* BrowserWindowCocoa::window() const { | 601 NSWindow* BrowserWindowCocoa::window() const { |
| 597 return [controller_ window]; | 602 return [controller_ window]; |
| 598 } | 603 } |
| 599 | 604 |
| 600 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { | 605 void BrowserWindowCocoa::UpdateSidebarForContents(TabContents* tab_contents) { |
| 601 if (tab_contents == browser_->GetSelectedTabContents()) { | 606 if (tab_contents == browser_->GetSelectedTabContents()) { |
| 602 [controller_ updateSidebarForContents:tab_contents]; | 607 [controller_ updateSidebarForContents:tab_contents]; |
| 603 } | 608 } |
| 604 } | 609 } |
| OLD | NEW |