| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Shell* shell_; | 61 Shell* shell_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(DevToolsWebContentsObserver); | 63 DISALLOW_COPY_AND_ASSIGN(DevToolsWebContentsObserver); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 Shell::Shell(WebContents* web_contents) | 66 Shell::Shell(WebContents* web_contents) |
| 67 : WebContentsObserver(web_contents), | 67 : WebContentsObserver(web_contents), |
| 68 devtools_frontend_(NULL), | 68 devtools_frontend_(NULL), |
| 69 is_fullscreen_(false), | 69 is_fullscreen_(false), |
| 70 window_(NULL), | 70 window_(NULL), |
| 71 #if defined(OS_MACOSX) |
| 71 url_edit_view_(NULL), | 72 url_edit_view_(NULL), |
| 73 #endif |
| 72 headless_(false) { | 74 headless_(false) { |
| 73 const base::CommandLine& command_line = | 75 const base::CommandLine& command_line = |
| 74 *base::CommandLine::ForCurrentProcess(); | 76 *base::CommandLine::ForCurrentProcess(); |
| 75 if (command_line.HasSwitch(switches::kRunLayoutTest)) | 77 if (command_line.HasSwitch(switches::kRunLayoutTest)) |
| 76 headless_ = true; | 78 headless_ = true; |
| 77 windows_.push_back(this); | 79 windows_.push_back(this); |
| 78 | 80 |
| 79 if (!shell_created_callback_.is_null()) { | 81 if (!shell_created_callback_.is_null()) { |
| 80 shell_created_callback_.Run(this); | 82 shell_created_callback_.Run(this); |
| 81 shell_created_callback_.Reset(); | 83 shell_created_callback_.Reset(); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 devtools_frontend_->Activate(); | 442 devtools_frontend_->Activate(); |
| 441 devtools_frontend_->Focus(); | 443 devtools_frontend_->Focus(); |
| 442 } | 444 } |
| 443 | 445 |
| 444 void Shell::OnDevToolsWebContentsDestroyed() { | 446 void Shell::OnDevToolsWebContentsDestroyed() { |
| 445 devtools_observer_.reset(); | 447 devtools_observer_.reset(); |
| 446 devtools_frontend_ = NULL; | 448 devtools_frontend_ = NULL; |
| 447 } | 449 } |
| 448 | 450 |
| 449 } // namespace content | 451 } // namespace content |
| OLD | NEW |