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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 395 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
396 switches::kRunLayoutTest)) | 396 switches::kRunLayoutTest)) |
397 return; | 397 return; |
398 BlinkTestController::Get()->RendererUnresponsive(); | 398 BlinkTestController::Get()->RendererUnresponsive(); |
399 } | 399 } |
400 | 400 |
401 void Shell::ActivateContents(WebContents* contents) { | 401 void Shell::ActivateContents(WebContents* contents) { |
402 contents->GetRenderViewHost()->GetWidget()->Focus(); | 402 contents->GetRenderViewHost()->GetWidget()->Focus(); |
403 } | 403 } |
404 | 404 |
405 void Shell::DeactivateContents(WebContents* contents) { | |
406 contents->GetRenderViewHost()->GetWidget()->Blur(); | |
407 } | |
408 | |
409 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { | 405 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { |
410 return PlatformHandleContextMenu(params); | 406 return PlatformHandleContextMenu(params); |
411 } | 407 } |
412 | 408 |
413 gfx::Size Shell::GetShellDefaultSize() { | 409 gfx::Size Shell::GetShellDefaultSize() { |
414 static gfx::Size default_shell_size; | 410 static gfx::Size default_shell_size; |
415 if (!default_shell_size.IsEmpty()) | 411 if (!default_shell_size.IsEmpty()) |
416 return default_shell_size; | 412 return default_shell_size; |
417 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 413 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
418 if (command_line->HasSwitch(switches::kContentShellHostWindowSize)) { | 414 if (command_line->HasSwitch(switches::kContentShellHostWindowSize)) { |
(...skipping 24 matching lines...) Expand all Loading... |
443 devtools_frontend_->Activate(); | 439 devtools_frontend_->Activate(); |
444 devtools_frontend_->Focus(); | 440 devtools_frontend_->Focus(); |
445 } | 441 } |
446 | 442 |
447 void Shell::OnDevToolsWebContentsDestroyed() { | 443 void Shell::OnDevToolsWebContentsDestroyed() { |
448 devtools_observer_.reset(); | 444 devtools_observer_.reset(); |
449 devtools_frontend_ = NULL; | 445 devtools_frontend_ = NULL; |
450 } | 446 } |
451 | 447 |
452 } // namespace content | 448 } // namespace content |
OLD | NEW |