Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/shell/browser/shell.cc

Issue 644723002: Content Shell: Introduce LayoutTestDevToolsFrontend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/path_service.h" 10 #include "base/path_service.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "content/public/browser/devtools_agent_host.h" 15 #include "content/public/browser/devtools_agent_host.h"
16 #include "content/public/browser/navigation_controller.h" 16 #include "content/public/browser/navigation_controller.h"
17 #include "content/public/browser/navigation_entry.h" 17 #include "content/public/browser/navigation_entry.h"
18 #include "content/public/browser/render_view_host.h" 18 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 #include "content/public/browser/web_contents_observer.h" 20 #include "content/public/browser/web_contents_observer.h"
21 #include "content/public/common/renderer_preferences.h" 21 #include "content/public/common/renderer_preferences.h"
22 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h"
22 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage r.h" 23 #include "content/shell/browser/layout_test/layout_test_javascript_dialog_manage r.h"
23 #include "content/shell/browser/notify_done_forwarder.h" 24 #include "content/shell/browser/notify_done_forwarder.h"
24 #include "content/shell/browser/shell_browser_main_parts.h" 25 #include "content/shell/browser/shell_browser_main_parts.h"
25 #include "content/shell/browser/shell_content_browser_client.h" 26 #include "content/shell/browser/shell_content_browser_client.h"
26 #include "content/shell/browser/shell_devtools_frontend.h" 27 #include "content/shell/browser/shell_devtools_frontend.h"
27 #include "content/shell/browser/shell_javascript_dialog_manager.h" 28 #include "content/shell/browser/shell_javascript_dialog_manager.h"
28 #include "content/shell/browser/webkit_test_controller.h" 29 #include "content/shell/browser/webkit_test_controller.h"
29 #include "content/shell/common/shell_messages.h" 30 #include "content/shell/common/shell_messages.h"
30 #include "content/shell/common/shell_switches.h" 31 #include "content/shell/common/shell_switches.h"
31 32
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 379 }
379 380
380 void Shell::TitleWasSet(NavigationEntry* entry, bool explicit_set) { 381 void Shell::TitleWasSet(NavigationEntry* entry, bool explicit_set) {
381 if (entry) 382 if (entry)
382 PlatformSetTitle(entry->GetTitle()); 383 PlatformSetTitle(entry->GetTitle());
383 } 384 }
384 385
385 void Shell::InnerShowDevTools(const std::string& settings, 386 void Shell::InnerShowDevTools(const std::string& settings,
386 const std::string& frontend_url) { 387 const std::string& frontend_url) {
387 if (!devtools_frontend_) { 388 if (!devtools_frontend_) {
388 devtools_frontend_ = ShellDevToolsFrontend::Show( 389 if (CommandLine::ForCurrentProcess()->HasSwitch(
389 web_contents(), settings, frontend_url); 390 switches::kDumpRenderTree)) {
391 devtools_frontend_ = LayoutTestDevToolsFrontend::Show(
392 web_contents(), settings, frontend_url);
393 } else {
394 devtools_frontend_ = ShellDevToolsFrontend::Show(web_contents());
395 }
390 devtools_observer_.reset(new DevToolsWebContentsObserver( 396 devtools_observer_.reset(new DevToolsWebContentsObserver(
391 this, devtools_frontend_->frontend_shell()->web_contents())); 397 this, devtools_frontend_->frontend_shell()->web_contents()));
392 } 398 }
393 399
394 devtools_frontend_->Activate(); 400 devtools_frontend_->Activate();
395 devtools_frontend_->Focus(); 401 devtools_frontend_->Focus();
396 } 402 }
397 403
398 void Shell::OnDevToolsWebContentsDestroyed() { 404 void Shell::OnDevToolsWebContentsDestroyed() {
399 devtools_observer_.reset(); 405 devtools_observer_.reset();
400 devtools_frontend_ = NULL; 406 devtools_frontend_ = NULL;
401 } 407 }
402 408
403 } // namespace content 409 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/layout_test/layout_test_devtools_frontend.cc ('k') | content/shell/browser/shell_devtools_frontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698