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

Side by Side Diff: webkit/tools/test_shell/test_shell.cc

Issue 2864020: DevTools: Migrate to new WebView initialization (pass devtools client directly). (Closed)
Patch Set: deps roll Created 10 years, 6 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #undef LOG 5 #undef LOG
6 6
7 #include "webkit/tools/test_shell/test_shell.h" 7 #include "webkit/tools/test_shell/test_shell.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 if (layout_test_mode_ && !layout_test_controller_->CanOpenWindows()) 576 if (layout_test_mode_ && !layout_test_controller_->CanOpenWindows())
577 return NULL; 577 return NULL;
578 578
579 TestShell* new_win; 579 TestShell* new_win;
580 if (!CreateNewWindow(GURL(), &new_win)) 580 if (!CreateNewWindow(GURL(), &new_win))
581 return NULL; 581 return NULL;
582 582
583 return new_win->webView(); 583 return new_win->webView();
584 } 584 }
585 585
586 void TestShell::InitializeDevToolsAgent(WebView* webView) {
587 DCHECK(!dev_tools_agent_.get());
588 dev_tools_agent_.reset(new TestShellDevToolsAgent(webView));
589 }
590
591 void TestShell::ShowDevTools() { 586 void TestShell::ShowDevTools() {
592 if (!devtools_shell_) { 587 if (!devtools_shell_) {
593 FilePath dir_exe; 588 FilePath dir_exe;
594 PathService::Get(base::DIR_EXE, &dir_exe); 589 PathService::Get(base::DIR_EXE, &dir_exe);
595 FilePath devtools_path = 590 FilePath devtools_path =
596 dir_exe.AppendASCII("resources/inspector/devtools.html"); 591 dir_exe.AppendASCII("resources/inspector/devtools.html");
597 TestShell* devtools_shell; 592 TestShell* devtools_shell;
598 TestShell::CreateNewWindow(GURL(devtools_path.value()), 593 TestShell::CreateNewWindow(GURL(devtools_path.value()),
599 &devtools_shell); 594 &devtools_shell);
600 devtools_shell_ = devtools_shell->AsWeakPtr(); 595 devtools_shell_ = devtools_shell->AsWeakPtr();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 804
810 void ClearCache() { 805 void ClearCache() {
811 // Used in benchmarking, Ignored for test_shell. 806 // Used in benchmarking, Ignored for test_shell.
812 } 807 }
813 808
814 std::string GetProductVersion() { 809 std::string GetProductVersion() {
815 return std::string("Chrome/0.0.0.0"); 810 return std::string("Chrome/0.0.0.0");
816 } 811 }
817 812
818 } // namespace webkit_glue 813 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell.h ('k') | webkit/tools/test_shell/test_shell_devtools_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698