| 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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 source->GetController().LoadURLWithParams(load_url_params); | 279 source->GetController().LoadURLWithParams(load_url_params); |
| 280 return source; | 280 return source; |
| 281 } | 281 } |
| 282 | 282 |
| 283 void Shell::LoadingStateChanged(WebContents* source, | 283 void Shell::LoadingStateChanged(WebContents* source, |
| 284 bool to_different_document) { | 284 bool to_different_document) { |
| 285 UpdateNavigationControls(to_different_document); | 285 UpdateNavigationControls(to_different_document); |
| 286 PlatformSetIsLoading(source->IsLoading()); | 286 PlatformSetIsLoading(source->IsLoading()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void Shell::EnterFullscreenModeForTab(WebContents* web_contents, |
| 290 const GURL& origin) { |
| 291 ToggleFullscreenModeForTab(web_contents, true); |
| 292 } |
| 293 |
| 294 void Shell::ExitFullscreenModeForTab(WebContents* web_contents) { |
| 295 ToggleFullscreenModeForTab(web_contents, false); |
| 296 } |
| 297 |
| 289 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, | 298 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 290 bool enter_fullscreen) { | 299 bool enter_fullscreen) { |
| 291 #if defined(OS_ANDROID) | 300 #if defined(OS_ANDROID) |
| 292 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); | 301 PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); |
| 293 #endif | 302 #endif |
| 294 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 303 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 295 return; | 304 return; |
| 296 if (is_fullscreen_ != enter_fullscreen) { | 305 if (is_fullscreen_ != enter_fullscreen) { |
| 297 is_fullscreen_ = enter_fullscreen; | 306 is_fullscreen_ = enter_fullscreen; |
| 298 web_contents->GetRenderViewHost()->WasResized(); | 307 web_contents->GetRenderViewHost()->WasResized(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 devtools_frontend_->Activate(); | 409 devtools_frontend_->Activate(); |
| 401 devtools_frontend_->Focus(); | 410 devtools_frontend_->Focus(); |
| 402 } | 411 } |
| 403 | 412 |
| 404 void Shell::OnDevToolsWebContentsDestroyed() { | 413 void Shell::OnDevToolsWebContentsDestroyed() { |
| 405 devtools_observer_.reset(); | 414 devtools_observer_.reset(); |
| 406 devtools_frontend_ = NULL; | 415 devtools_frontend_ = NULL; |
| 407 } | 416 } |
| 408 | 417 |
| 409 } // namespace content | 418 } // namespace content |
| OLD | NEW |