| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // view hierarchy somewhere. | 98 // view hierarchy somewhere. |
| 99 Profile* profile = BrowserList::GetLastActive()->profile(); | 99 Profile* profile = BrowserList::GetLastActive()->profile(); |
| 100 TabContents* tc = TabContents::CreateWithType(TAB_CONTENTS_DEBUGGER, profile, | 100 TabContents* tc = TabContents::CreateWithType(TAB_CONTENTS_DEBUGGER, profile, |
| 101 NULL); | 101 NULL); |
| 102 web_contents_ = tc->AsWebContents(); | 102 web_contents_ = tc->AsWebContents(); |
| 103 web_contents_->SetupController(profile); | 103 web_contents_->SetupController(profile); |
| 104 web_contents_->set_delegate(this); | 104 web_contents_->set_delegate(this); |
| 105 web_container_->SetTabContents(web_contents_); | 105 web_container_->SetTabContents(web_contents_); |
| 106 web_contents_->render_view_host()->AllowDOMUIBindings(); | 106 web_contents_->render_view_host()->AllowDOMUIBindings(); |
| 107 | 107 |
| 108 GURL contents("chrome://inspector/debugger.html"); | 108 GURL contents("chrome-ui://inspector/debugger.html"); |
| 109 web_contents_->controller()->LoadURL(contents, GURL(), | 109 web_contents_->controller()->LoadURL(contents, GURL(), |
| 110 PageTransition::START_PAGE); | 110 PageTransition::START_PAGE); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void DebuggerView::OnShow() { | 113 void DebuggerView::OnShow() { |
| 114 web_contents_->Focus(); | 114 web_contents_->Focus(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void DebuggerView::OnClose() { | 117 void DebuggerView::OnClose() { |
| 118 web_container_->SetTabContents(NULL); | 118 web_container_->SetTabContents(NULL); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void DebuggerView::ExecuteJavascript(const std::string& js) { | 151 void DebuggerView::ExecuteJavascript(const std::string& js) { |
| 152 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", | 152 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", |
| 153 UTF8ToWide(js)); | 153 UTF8ToWide(js)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void DebuggerView::LoadingStateChanged(TabContents* source) { | 156 void DebuggerView::LoadingStateChanged(TabContents* source) { |
| 157 if (!source->is_loading()) | 157 if (!source->is_loading()) |
| 158 SetOutputViewReady(); | 158 SetOutputViewReady(); |
| 159 } | 159 } |
| 160 | 160 |
| OLD | NEW |