| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // view hierarchy somewhere. | 93 // view hierarchy somewhere. |
| 94 Profile* profile = BrowserList::GetLastActive()->profile(); | 94 Profile* profile = BrowserList::GetLastActive()->profile(); |
| 95 TabContents* tc = TabContents::CreateWithType(TAB_CONTENTS_DEBUGGER, profile, | 95 TabContents* tc = TabContents::CreateWithType(TAB_CONTENTS_DEBUGGER, profile, |
| 96 NULL); | 96 NULL); |
| 97 web_contents_ = tc->AsWebContents(); | 97 web_contents_ = tc->AsWebContents(); |
| 98 web_contents_->SetupController(profile); | 98 web_contents_->SetupController(profile); |
| 99 web_contents_->set_delegate(this); | 99 web_contents_->set_delegate(this); |
| 100 web_container_->SetTabContents(web_contents_); | 100 web_container_->SetTabContents(web_contents_); |
| 101 web_contents_->render_view_host()->AllowDOMUIBindings(); | 101 web_contents_->render_view_host()->AllowDOMUIBindings(); |
| 102 | 102 |
| 103 GURL contents("chrome-resource://debugger/"); | 103 GURL contents("chrome://debugger/"); |
| 104 web_contents_->controller()->LoadURL(contents, GURL(), | 104 web_contents_->controller()->LoadURL(contents, GURL(), |
| 105 PageTransition::START_PAGE); | 105 PageTransition::START_PAGE); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void DebuggerView::OnShow() { | 108 void DebuggerView::OnShow() { |
| 109 web_contents_->Focus(); | 109 web_contents_->Focus(); |
| 110 if (output_ready_) | 110 if (output_ready_) |
| 111 ExecuteJavascript("focusOnCommandLine()"); | 111 ExecuteJavascript("focusOnCommandLine()"); |
| 112 } | 112 } |
| 113 | 113 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 134 void DebuggerView::ExecuteJavascript(const std::string& js) { | 134 void DebuggerView::ExecuteJavascript(const std::string& js) { |
| 135 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", | 135 web_contents_->render_view_host()->ExecuteJavascriptInWebFrame(L"", |
| 136 UTF8ToWide(js)); | 136 UTF8ToWide(js)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void DebuggerView::LoadingStateChanged(TabContents* source) { | 139 void DebuggerView::LoadingStateChanged(TabContents* source) { |
| 140 if (!source->is_loading()) | 140 if (!source->is_loading()) |
| 141 SetOutputViewReady(); | 141 SetOutputViewReady(); |
| 142 } | 142 } |
| 143 | 143 |
| OLD | NEW |