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> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 const base::CommandLine& command_line = | 377 const base::CommandLine& command_line = |
378 *base::CommandLine::ForCurrentProcess(); | 378 *base::CommandLine::ForCurrentProcess(); |
379 dialog_manager_.reset(command_line.HasSwitch(switches::kRunLayoutTest) | 379 dialog_manager_.reset(command_line.HasSwitch(switches::kRunLayoutTest) |
380 ? new LayoutTestJavaScriptDialogManager | 380 ? new LayoutTestJavaScriptDialogManager |
381 : new ShellJavaScriptDialogManager); | 381 : new ShellJavaScriptDialogManager); |
382 } | 382 } |
383 return dialog_manager_.get(); | 383 return dialog_manager_.get(); |
384 } | 384 } |
385 | 385 |
386 scoped_ptr<BluetoothChooser> Shell::RunBluetoothChooser( | 386 scoped_ptr<BluetoothChooser> Shell::RunBluetoothChooser( |
387 WebContents* web_contents, | 387 RenderFrameHost* frame, |
388 const BluetoothChooser::EventHandler& event_handler, | 388 const BluetoothChooser::EventHandler& event_handler) { |
389 const url::Origin& origin) { | |
390 const base::CommandLine& command_line = | 389 const base::CommandLine& command_line = |
391 *base::CommandLine::ForCurrentProcess(); | 390 *base::CommandLine::ForCurrentProcess(); |
392 if (command_line.HasSwitch(switches::kRunLayoutTest)) { | 391 if (command_line.HasSwitch(switches::kRunLayoutTest)) { |
393 return BlinkTestController::Get()->RunBluetoothChooser( | 392 return BlinkTestController::Get()->RunBluetoothChooser(frame, |
394 web_contents, event_handler, origin); | 393 event_handler); |
395 } | 394 } |
396 return nullptr; | 395 return nullptr; |
397 } | 396 } |
398 | 397 |
399 bool Shell::AddMessageToConsole(WebContents* source, | 398 bool Shell::AddMessageToConsole(WebContents* source, |
400 int32_t level, | 399 int32_t level, |
401 const base::string16& message, | 400 const base::string16& message, |
402 int32_t line_no, | 401 int32_t line_no, |
403 const base::string16& source_id) { | 402 const base::string16& source_id) { |
404 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 403 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 devtools_frontend_->Activate(); | 459 devtools_frontend_->Activate(); |
461 devtools_frontend_->Focus(); | 460 devtools_frontend_->Focus(); |
462 } | 461 } |
463 | 462 |
464 void Shell::OnDevToolsWebContentsDestroyed() { | 463 void Shell::OnDevToolsWebContentsDestroyed() { |
465 devtools_observer_.reset(); | 464 devtools_observer_.reset(); |
466 devtools_frontend_ = NULL; | 465 devtools_frontend_ = NULL; |
467 } | 466 } |
468 | 467 |
469 } // namespace content | 468 } // namespace content |
OLD | NEW |