| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/debugger/debugger_window.h" | 5 #include "chrome/browser/debugger/debugger_window.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/json_writer.h" | 9 #include "base/json_writer.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 DictionaryValue* body = new DictionaryValue; | 91 DictionaryValue* body = new DictionaryValue; |
| 92 body->Set(L"text", Value::CreateStringValue(out)); | 92 body->Set(L"text", Value::CreateStringValue(out)); |
| 93 SendEventToPage(L"appendText", body); | 93 SendEventToPage(L"appendText", body); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void DebuggerView::OnInit() { | 96 void DebuggerView::OnInit() { |
| 97 // We can't create the WebContents until we've actually been put into a real | 97 // We can't create the WebContents until we've actually been put into a real |
| 98 // view hierarchy somewhere. | 98 // view hierarchy somewhere. |
| 99 Profile* profile = BrowserList::GetLastActive()->profile(); | 99 Profile* profile = BrowserList::GetLastActive()->profile(); |
| 100 web_contents_ = new WebContents(profile, NULL, NULL, MSG_ROUTING_NONE, NULL); | 100 web_contents_ = new WebContents(profile, NULL, MSG_ROUTING_NONE, NULL); |
| 101 | 101 |
| 102 web_contents_->SetupController(profile); | 102 web_contents_->SetupController(profile); |
| 103 web_contents_->set_delegate(this); | 103 web_contents_->set_delegate(this); |
| 104 web_container_->SetTabContents(web_contents_); | 104 web_container_->SetTabContents(web_contents_); |
| 105 web_contents_->render_view_host()->AllowDOMUIBindings(); | 105 web_contents_->render_view_host()->AllowDOMUIBindings(); |
| 106 | 106 |
| 107 GURL contents("chrome-ui://inspector/debugger.html"); | 107 GURL contents("chrome-ui://inspector/debugger.html"); |
| 108 web_contents_->controller()->LoadURL(contents, GURL(), | 108 web_contents_->controller()->LoadURL(contents, GURL(), |
| 109 PageTransition::START_PAGE); | 109 PageTransition::START_PAGE); |
| 110 } | 110 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 void DebuggerView::ExecuteJavascript(const std::string& js) { | 150 void DebuggerView::ExecuteJavascript(const std::string& js) { |
| 151 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", | 151 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", |
| 152 UTF8ToWide(js)); | 152 UTF8ToWide(js)); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void DebuggerView::LoadingStateChanged(TabContents* source) { | 155 void DebuggerView::LoadingStateChanged(TabContents* source) { |
| 156 if (!source->is_loading()) | 156 if (!source->is_loading()) |
| 157 SetOutputViewReady(); | 157 SetOutputViewReady(); |
| 158 } | 158 } |
| OLD | NEW |