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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 | 251 |
252 bool BrowserWindowCocoa::IsMaximized() const { | 252 bool BrowserWindowCocoa::IsMaximized() const { |
253 return [window() isZoomed]; | 253 return [window() isZoomed]; |
254 } | 254 } |
255 | 255 |
256 bool BrowserWindowCocoa::IsMinimized() const { | 256 bool BrowserWindowCocoa::IsMinimized() const { |
257 return [window() isMiniaturized]; | 257 return [window() isMiniaturized]; |
258 } | 258 } |
259 | 259 |
| 260 void BrowserWindowCocoa::Maximize() { |
| 261 // Zoom toggles so only call if not already maximized. |
| 262 if (!IsMaximized()) |
| 263 [window() zoom:controller_]; |
| 264 } |
| 265 |
| 266 void BrowserWindowCocoa::Minimize() { |
| 267 [window() miniaturize:controller_]; |
| 268 } |
| 269 |
| 270 void BrowserWindowCocoa::Restore() { |
| 271 if (IsMaximized()) |
| 272 [window() zoom:controller_]; // Toggles zoom mode. |
| 273 else if (IsMinimized()) |
| 274 [window() deminiaturize:controller_]; |
| 275 } |
| 276 |
260 void BrowserWindowCocoa::EnterFullscreen( | 277 void BrowserWindowCocoa::EnterFullscreen( |
261 const GURL& url, FullscreenExitBubbleType bubble_type) { | 278 const GURL& url, FullscreenExitBubbleType bubble_type) { |
262 [controller_ enterFullscreenForURL:url | 279 [controller_ enterFullscreenForURL:url |
263 bubbleType:bubble_type]; | 280 bubbleType:bubble_type]; |
264 } | 281 } |
265 | 282 |
266 void BrowserWindowCocoa::ExitFullscreen() { | 283 void BrowserWindowCocoa::ExitFullscreen() { |
267 [controller_ exitFullscreen]; | 284 [controller_ exitFullscreen]; |
268 } | 285 } |
269 | 286 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 AvatarMenuBubbleController* menu = | 630 AvatarMenuBubbleController* menu = |
614 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 631 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
615 anchoredAt:point]; | 632 anchoredAt:point]; |
616 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 633 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
617 [menu showWindow:nil]; | 634 [menu showWindow:nil]; |
618 } | 635 } |
619 | 636 |
620 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 637 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
621 [[controller_ avatarButtonController] showAvatarBubble]; | 638 [[controller_ avatarButtonController] showAvatarBubble]; |
622 } | 639 } |
OLD | NEW |