| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (did_save_animation_behavior) | 138 if (did_save_animation_behavior) |
| 139 [window() setAnimationBehavior:saved_animation_behavior]; | 139 [window() setAnimationBehavior:saved_animation_behavior]; |
| 140 | 140 |
| 141 browser_->OnWindowDidShow(); | 141 browser_->OnWindowDidShow(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void BrowserWindowCocoa::ShowInactive() { | 144 void BrowserWindowCocoa::ShowInactive() { |
| 145 [window() orderFront:controller_]; | 145 [window() orderFront:controller_]; |
| 146 } | 146 } |
| 147 | 147 |
| 148 void BrowserWindowCocoa::Hide() { |
| 149 // Not implemented. |
| 150 } |
| 151 |
| 148 void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) { | 152 void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) { |
| 149 gfx::Rect real_bounds = [controller_ enforceMinWindowSize:bounds]; | 153 gfx::Rect real_bounds = [controller_ enforceMinWindowSize:bounds]; |
| 150 | 154 |
| 151 ExitFullscreen(); | 155 ExitFullscreen(); |
| 152 NSRect cocoa_bounds = NSMakeRect(real_bounds.x(), 0, | 156 NSRect cocoa_bounds = NSMakeRect(real_bounds.x(), 0, |
| 153 real_bounds.width(), | 157 real_bounds.width(), |
| 154 real_bounds.height()); | 158 real_bounds.height()); |
| 155 // Flip coordinates based on the primary screen. | 159 // Flip coordinates based on the primary screen. |
| 156 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 160 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
| 157 cocoa_bounds.origin.y = | 161 cocoa_bounds.origin.y = |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 AvatarMenuBubbleController* menu = | 668 AvatarMenuBubbleController* menu = |
| 665 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 669 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
| 666 anchoredAt:point]; | 670 anchoredAt:point]; |
| 667 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 671 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
| 668 [menu showWindow:nil]; | 672 [menu showWindow:nil]; |
| 669 } | 673 } |
| 670 | 674 |
| 671 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 675 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
| 672 [[controller_ avatarButtonController] showAvatarBubble]; | 676 [[controller_ avatarButtonController] showAvatarBubble]; |
| 673 } | 677 } |
| OLD | NEW |