| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 void BrowserWindowCocoa::Restore() { | 368 void BrowserWindowCocoa::Restore() { |
| 369 if (IsMaximized()) | 369 if (IsMaximized()) |
| 370 [window() zoom:controller_]; // Toggles zoom mode. | 370 [window() zoom:controller_]; // Toggles zoom mode. |
| 371 else if (IsMinimized()) | 371 else if (IsMinimized()) |
| 372 [window() deminiaturize:controller_]; | 372 [window() deminiaturize:controller_]; |
| 373 } | 373 } |
| 374 | 374 |
| 375 // See browser_window_controller.h for a detailed explanation of the logic in | 375 // See browser_window_controller.h for a detailed explanation of the logic in |
| 376 // this method. | 376 // this method. |
| 377 void BrowserWindowCocoa::EnterFullscreen(const GURL& url, | 377 void BrowserWindowCocoa::EnterFullscreen(const GURL& url, |
| 378 FullscreenExitBubbleType bubble_type, | 378 ExclusiveAccessBubbleType bubble_type, |
| 379 bool with_toolbar) { | 379 bool with_toolbar) { |
| 380 if (browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending()) | 380 if (browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending()) |
| 381 [controller_ enterWebContentFullscreenForURL:url bubbleType:bubble_type]; | 381 [controller_ enterWebContentFullscreenForURL:url bubbleType:bubble_type]; |
| 382 else if (!url.is_empty()) | 382 else if (!url.is_empty()) |
| 383 [controller_ enterExtensionFullscreenForURL:url bubbleType:bubble_type]; | 383 [controller_ enterExtensionFullscreenForURL:url bubbleType:bubble_type]; |
| 384 else | 384 else |
| 385 [controller_ enterBrowserFullscreenWithToolbar:with_toolbar]; | 385 [controller_ enterBrowserFullscreenWithToolbar:with_toolbar]; |
| 386 } | 386 } |
| 387 | 387 |
| 388 void BrowserWindowCocoa::ExitFullscreen() { | 388 void BrowserWindowCocoa::ExitFullscreen() { |
| 389 [controller_ exitAnyFullscreen]; | 389 [controller_ exitAnyFullscreen]; |
| 390 } | 390 } |
| 391 | 391 |
| 392 void BrowserWindowCocoa::UpdateFullscreenExitBubbleContent( | 392 void BrowserWindowCocoa::UpdateFullscreenExitBubbleContent( |
| 393 const GURL& url, | 393 const GURL& url, |
| 394 FullscreenExitBubbleType bubble_type) { | 394 ExclusiveAccessBubbleType bubble_type) { |
| 395 [controller_ updateFullscreenExitBubbleURL:url bubbleType:bubble_type]; | 395 [controller_ updateFullscreenExitBubbleURL:url bubbleType:bubble_type]; |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { | 398 bool BrowserWindowCocoa::ShouldHideUIForFullscreen() const { |
| 399 // On Mac, fullscreen mode has most normal things (in a slide-down panel). | 399 // On Mac, fullscreen mode has most normal things (in a slide-down panel). |
| 400 return false; | 400 return false; |
| 401 } | 401 } |
| 402 | 402 |
| 403 bool BrowserWindowCocoa::IsFullscreen() const { | 403 bool BrowserWindowCocoa::IsFullscreen() const { |
| 404 return [controller_ isInAnyFullscreenMode]; | 404 return [controller_ isInAnyFullscreenMode]; |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) | 807 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) |
| 808 return 0; | 808 return 0; |
| 809 return 40; | 809 return 40; |
| 810 } | 810 } |
| 811 | 811 |
| 812 void BrowserWindowCocoa::ExecuteExtensionCommand( | 812 void BrowserWindowCocoa::ExecuteExtensionCommand( |
| 813 const extensions::Extension* extension, | 813 const extensions::Extension* extension, |
| 814 const extensions::Command& command) { | 814 const extensions::Command& command) { |
| 815 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; | 815 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; |
| 816 } | 816 } |
| OLD | NEW |