summaryrefslogtreecommitdiffstats
path: root/content/shell/shell.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 09:01:06 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 09:01:06 +0000
commitc272c5b50cd0e1441edb66dce7d8e0e52e693400 (patch)
tree86d77197049bd1216e097ee112b797b6fcd0e363 /content/shell/shell.cc
parentf7ee881d918bceec4bb6a23e54b052b6b3ac4409 (diff)
downloadchromium_src-c272c5b50cd0e1441edb66dce7d8e0e52e693400.zip
chromium_src-c272c5b50cd0e1441edb66dce7d8e0e52e693400.tar.gz
chromium_src-c272c5b50cd0e1441edb66dce7d8e0e52e693400.tar.bz2
Add support to content_shell for printing and render tree dumps
Also hook up console.log and alert/prompt/confirm and onunload handlers BUG=111316 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10537005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell.cc')
-rw-r--r--content/shell/shell.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/content/shell/shell.cc b/content/shell/shell.cc
index 5692b82..11b121e 100644
--- a/content/shell/shell.cc
+++ b/content/shell/shell.cc
@@ -4,11 +4,14 @@
#include "content/shell/shell.h"
+#include <iostream>
+
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_details.h"
@@ -32,9 +35,7 @@ std::vector<Shell*> Shell::windows_;
bool Shell::quit_message_loop_ = true;
Shell::Shell(WebContents* web_contents)
- : WebContentsObserver(web_contents),
- wait_until_done_(false),
- window_(NULL),
+ : window_(NULL),
url_edit_view_(NULL)
#if defined(OS_WIN) && !defined(USE_AURA)
, default_edit_wnd_proc_(0)
@@ -163,25 +164,24 @@ void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) {
}
JavaScriptDialogCreator* Shell::GetJavaScriptDialogCreator() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
- return NULL;
-
if (!dialog_creator_.get())
dialog_creator_.reset(new ShellJavaScriptDialogCreator());
return dialog_creator_.get();
}
-void Shell::DidFinishLoad(int64 frame_id,
- const GURL& validated_url,
- bool is_main_frame) {
- if (!is_main_frame || wait_until_done_)
- return;
+bool Shell::AddMessageToConsole(WebContents* source,
+ int32 level,
+ const string16& message,
+ int32 line_no,
+ const string16& source_id) {
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
- return;
- RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
- render_view_host->Send(
- new ShellViewMsg_CaptureTextDump(render_view_host->GetRoutingID(),
- false));
+ return false;
+
+ std::cout << "CONSOLE MESSAGE: ";
+ if (line_no)
+ std::cout << "line " << line_no << ": ";
+ std::cout << UTF16ToUTF8(message) << "\n";
+ return true;
}
void Shell::Observe(int type,