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 <stddef.h> |
| 8 |
7 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" |
10 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 19 #include "build/build_config.h" |
16 #include "content/public/browser/devtools_agent_host.h" | 20 #include "content/public/browser/devtools_agent_host.h" |
17 #include "content/public/browser/navigation_controller.h" | 21 #include "content/public/browser/navigation_controller.h" |
18 #include "content/public/browser/navigation_entry.h" | 22 #include "content/public/browser/navigation_entry.h" |
19 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/browser/render_widget_host.h" | 24 #include "content/public/browser/render_widget_host.h" |
21 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
22 #include "content/public/browser/web_contents_observer.h" | 26 #include "content/public/browser/web_contents_observer.h" |
23 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
24 #include "content/public/common/renderer_preferences.h" | 28 #include "content/public/common/renderer_preferences.h" |
25 #include "content/public/common/webrtc_ip_handling_policy.h" | 29 #include "content/public/common/webrtc_ip_handling_policy.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const base::CommandLine& command_line = | 357 const base::CommandLine& command_line = |
354 *base::CommandLine::ForCurrentProcess(); | 358 *base::CommandLine::ForCurrentProcess(); |
355 if (command_line.HasSwitch(switches::kRunLayoutTest)) { | 359 if (command_line.HasSwitch(switches::kRunLayoutTest)) { |
356 return BlinkTestController::Get()->RunBluetoothChooser( | 360 return BlinkTestController::Get()->RunBluetoothChooser( |
357 web_contents, event_handler, origin); | 361 web_contents, event_handler, origin); |
358 } | 362 } |
359 return nullptr; | 363 return nullptr; |
360 } | 364 } |
361 | 365 |
362 bool Shell::AddMessageToConsole(WebContents* source, | 366 bool Shell::AddMessageToConsole(WebContents* source, |
363 int32 level, | 367 int32_t level, |
364 const base::string16& message, | 368 const base::string16& message, |
365 int32 line_no, | 369 int32_t line_no, |
366 const base::string16& source_id) { | 370 const base::string16& source_id) { |
367 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 371 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
368 switches::kRunLayoutTest); | 372 switches::kRunLayoutTest); |
369 } | 373 } |
370 | 374 |
371 void Shell::RendererUnresponsive(WebContents* source) { | 375 void Shell::RendererUnresponsive(WebContents* source) { |
372 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 376 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
373 switches::kRunLayoutTest)) | 377 switches::kRunLayoutTest)) |
374 return; | 378 return; |
375 BlinkTestController::Get()->RendererUnresponsive(); | 379 BlinkTestController::Get()->RendererUnresponsive(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 devtools_frontend_->Activate(); | 420 devtools_frontend_->Activate(); |
417 devtools_frontend_->Focus(); | 421 devtools_frontend_->Focus(); |
418 } | 422 } |
419 | 423 |
420 void Shell::OnDevToolsWebContentsDestroyed() { | 424 void Shell::OnDevToolsWebContentsDestroyed() { |
421 devtools_observer_.reset(); | 425 devtools_observer_.reset(); |
422 devtools_frontend_ = NULL; | 426 devtools_frontend_ = NULL; |
423 } | 427 } |
424 | 428 |
425 } // namespace content | 429 } // namespace content |
OLD | NEW |