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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 [window() miniaturize:controller_]; | 418 [window() miniaturize:controller_]; |
419 } | 419 } |
420 | 420 |
421 void BrowserWindowCocoa::Restore() { | 421 void BrowserWindowCocoa::Restore() { |
422 if (IsMaximized()) | 422 if (IsMaximized()) |
423 [window() zoom:controller_]; // Toggles zoom mode. | 423 [window() zoom:controller_]; // Toggles zoom mode. |
424 else if (IsMinimized()) | 424 else if (IsMinimized()) |
425 [window() deminiaturize:controller_]; | 425 [window() deminiaturize:controller_]; |
426 } | 426 } |
427 | 427 |
| 428 void BrowserWindowCocoa::SetFullscreen(bool fullscreen) { |
| 429 if (fullscreen) |
| 430 GetExclusiveAccessContext()->EnterFullscreen( |
| 431 GURL(), EXCLUSIVE_ACCESS_BUBBLE_TYPE_NONE); |
| 432 else |
| 433 GetExclusiveAccessContext()->ExitFullscreen(); |
| 434 } |
| 435 |
428 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { | 436 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { |
429 // On Mac, fullscreen mode has most normal things (in a slide-down panel). | 437 // On Mac, fullscreen mode has most normal things (in a slide-down panel). |
430 return false; | 438 return false; |
431 } | 439 } |
432 | 440 |
433 bool BrowserWindowCocoa::IsFullscreen() const { | 441 bool BrowserWindowCocoa::IsFullscreen() const { |
434 return [controller_ isInAnyFullscreenMode]; | 442 return [controller_ isInAnyFullscreenMode]; |
435 } | 443 } |
436 | 444 |
437 bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const { | 445 bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const { |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 846 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
839 return [controller_ exclusiveAccessController]; | 847 return [controller_ exclusiveAccessController]; |
840 } | 848 } |
841 | 849 |
842 void BrowserWindowCocoa::ShowImeWarningBubble( | 850 void BrowserWindowCocoa::ShowImeWarningBubble( |
843 const extensions::Extension* extension, | 851 const extensions::Extension* extension, |
844 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 852 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
845 callback) { | 853 callback) { |
846 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 854 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
847 } | 855 } |
OLD | NEW |