Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| index 73704d8969dbe778fc254d5e1cc010c9e97c2f0a..440d51345869d492669b02ff67d3ff3b798f752b 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| @@ -43,6 +43,7 @@ |
| #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
| #import "chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h" |
| +#include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| #include "chrome/browser/ui/search/search_model.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| #include "chrome/browser/web_applications/web_app.h" |
| @@ -350,9 +351,20 @@ void BrowserWindowCocoa::Restore() { |
| [window() deminiaturize:controller_]; |
| } |
| -void BrowserWindowCocoa::EnterFullscreen( |
| - const GURL& url, FullscreenExitBubbleType bubble_type) { |
| - [controller_ enterHTML5FullscreenForURL:url bubbleType:bubble_type]; |
| +// See browser_window_controller.h for a detailed explanation of the logic in |
| +// this method. |
| +void BrowserWindowCocoa::EnterFullscreen(const GURL& url, |
| + FullscreenExitBubbleType bubble_type) { |
|
erikchen
2014/09/15 23:55:37
I considered moving this logic into fullscreen_con
|
| + if (browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending()) { |
| + [controller_ enterWebContentFullscreenForURL:url bubbleType:bubble_type]; |
| + return; |
| + } |
| + |
| + if (url.is_empty()) { |
| + [controller_ enterPresentationMode]; |
| + } else { |
| + [controller_ enterExtensionFullscreenForURL:url bubbleType:bubble_type]; |
| + } |
| } |
| void BrowserWindowCocoa::ExitFullscreen() { |