| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 const GURL& origin) { | 299 const GURL& origin) { |
| 300 ToggleFullscreenModeForTab(web_contents, true); | 300 ToggleFullscreenModeForTab(web_contents, true); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void Shell::ExitFullscreenModeForTab(WebContents* web_contents) { | 303 void Shell::ExitFullscreenModeForTab(WebContents* web_contents) { |
| 304 ToggleFullscreenModeForTab(web_contents, false); | 304 ToggleFullscreenModeForTab(web_contents, false); |
| 305 } | 305 } |
| 306 | 306 |
| 307 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, | 307 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 308 bool enter_fullscreen) { | 308 bool enter_fullscreen) { |
| 309 #if defined(OS_ANDROID) | 309 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 310 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); | 310 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); |
| 311 #endif | 311 #endif |
| 312 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 312 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 313 switches::kRunLayoutTest)) | 313 switches::kRunLayoutTest)) |
| 314 return; | 314 return; |
| 315 if (is_fullscreen_ != enter_fullscreen) { | 315 if (is_fullscreen_ != enter_fullscreen) { |
| 316 is_fullscreen_ = enter_fullscreen; | 316 is_fullscreen_ = enter_fullscreen; |
| 317 web_contents->GetRenderViewHost()->GetWidget()->WasResized(); | 317 web_contents->GetRenderViewHost()->GetWidget()->WasResized(); |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 | 320 |
| 321 bool Shell::IsFullscreenForTabOrPending(const WebContents* web_contents) const { | 321 bool Shell::IsFullscreenForTabOrPending(const WebContents* web_contents) const { |
| 322 #if defined(OS_ANDROID) | 322 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 323 return PlatformIsFullscreenForTabOrPending(web_contents); | 323 return PlatformIsFullscreenForTabOrPending(web_contents); |
| 324 #else | 324 #else |
| 325 return is_fullscreen_; | 325 return is_fullscreen_; |
| 326 #endif | 326 #endif |
| 327 } | 327 } |
| 328 | 328 |
| 329 blink::WebDisplayMode Shell::GetDisplayMode( | 329 blink::WebDisplayMode Shell::GetDisplayMode( |
| 330 const WebContents* web_contents) const { | 330 const WebContents* web_contents) const { |
| 331 // TODO : should return blink::WebDisplayModeFullscreen wherever user puts | 331 // TODO : should return blink::WebDisplayModeFullscreen wherever user puts |
| 332 // a browser window into fullscreen (not only in case of renderer-initiated | 332 // a browser window into fullscreen (not only in case of renderer-initiated |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 devtools_frontend_->Activate(); | 439 devtools_frontend_->Activate(); |
| 440 devtools_frontend_->Focus(); | 440 devtools_frontend_->Focus(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 void Shell::OnDevToolsWebContentsDestroyed() { | 443 void Shell::OnDevToolsWebContentsDestroyed() { |
| 444 devtools_observer_.reset(); | 444 devtools_observer_.reset(); |
| 445 devtools_frontend_ = NULL; | 445 devtools_frontend_ = NULL; |
| 446 } | 446 } |
| 447 | 447 |
| 448 } // namespace content | 448 } // namespace content |
| OLD | NEW |