| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 const GURL& origin) { | 288 const GURL& origin) { |
| 289 ToggleFullscreenModeForTab(web_contents, true); | 289 ToggleFullscreenModeForTab(web_contents, true); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void Shell::ExitFullscreenModeForTab(WebContents* web_contents) { | 292 void Shell::ExitFullscreenModeForTab(WebContents* web_contents) { |
| 293 ToggleFullscreenModeForTab(web_contents, false); | 293 ToggleFullscreenModeForTab(web_contents, false); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, | 296 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 297 bool enter_fullscreen) { | 297 bool enter_fullscreen) { |
| 298 #if defined(OS_ANDROID) | 298 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 299 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); | 299 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); |
| 300 #endif | 300 #endif |
| 301 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 301 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 302 switches::kRunLayoutTest)) | 302 switches::kRunLayoutTest)) |
| 303 return; | 303 return; |
| 304 if (is_fullscreen_ != enter_fullscreen) { | 304 if (is_fullscreen_ != enter_fullscreen) { |
| 305 is_fullscreen_ = enter_fullscreen; | 305 is_fullscreen_ = enter_fullscreen; |
| 306 web_contents->GetRenderViewHost()->WasResized(); | 306 web_contents->GetRenderViewHost()->WasResized(); |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 bool Shell::IsFullscreenForTabOrPending(const WebContents* web_contents) const { | 310 bool Shell::IsFullscreenForTabOrPending(const WebContents* web_contents) const { |
| 311 #if defined(OS_ANDROID) | 311 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 312 return PlatformIsFullscreenForTabOrPending(web_contents); | 312 return PlatformIsFullscreenForTabOrPending(web_contents); |
| 313 #else | 313 #else |
| 314 return is_fullscreen_; | 314 return is_fullscreen_; |
| 315 #endif | 315 #endif |
| 316 } | 316 } |
| 317 | 317 |
| 318 blink::WebDisplayMode Shell::GetDisplayMode( | 318 blink::WebDisplayMode Shell::GetDisplayMode( |
| 319 const WebContents* web_contents) const { | 319 const WebContents* web_contents) const { |
| 320 // TODO : should return blink::WebDisplayModeFullscreen wherever user puts | 320 // TODO : should return blink::WebDisplayModeFullscreen wherever user puts |
| 321 // a browser window into fullscreen (not only in case of renderer-initiated | 321 // a browser window into fullscreen (not only in case of renderer-initiated |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 devtools_frontend_->Activate(); | 419 devtools_frontend_->Activate(); |
| 420 devtools_frontend_->Focus(); | 420 devtools_frontend_->Focus(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void Shell::OnDevToolsWebContentsDestroyed() { | 423 void Shell::OnDevToolsWebContentsDestroyed() { |
| 424 devtools_observer_.reset(); | 424 devtools_observer_.reset(); |
| 425 devtools_frontend_ = NULL; | 425 devtools_frontend_ = NULL; |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace content | 428 } // namespace content |
| OLD | NEW |