| 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_view.h" | 5 #include "chrome/browser/debugger/debugger_view.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/json_writer.h" | 10 #include "base/json_writer.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/debugger/debugger_shell.h" | 14 #include "chrome/browser/debugger/debugger_shell.h" |
| 15 #include "chrome/browser/debugger/debugger_window.h" | 15 #include "chrome/browser/debugger/debugger_window.h" |
| 16 #include "chrome/browser/debugger/debugger_wrapper.h" | 16 #include "chrome/browser/debugger/debugger_wrapper.h" |
| 17 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 17 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 18 #include "chrome/browser/renderer_host/render_view_host.h" | 18 #include "chrome/browser/renderer_host/render_view_host.h" |
| 19 #include "chrome/browser/tab_contents/tab_contents.h" | 19 #include "chrome/browser/tab_contents/tab_contents.h" |
| 20 #include "chrome/browser/view_ids.h" | 20 #include "chrome/browser/view_ids.h" |
| 21 #include "chrome/browser/views/standard_layout.h" | 21 #include "chrome/browser/views/standard_layout.h" |
| 22 #include "chrome/browser/views/tab_contents_container_view.h" | 22 #include "chrome/browser/views/tab_contents_container_view.h" |
| 23 #include "chrome/common/gfx/chrome_canvas.h" | 23 #include "chrome/common/gfx/chrome_canvas.h" |
| 24 #include "chrome/common/url_constants.h" |
| 24 #include "chrome/views/grid_layout.h" | 25 #include "chrome/views/grid_layout.h" |
| 25 #include "chrome/views/controls/scrollbar/native_scroll_bar.h" | 26 #include "chrome/views/controls/scrollbar/native_scroll_bar.h" |
| 26 #include "chrome/views/controls/scroll_view.h" | 27 #include "chrome/views/controls/scroll_view.h" |
| 27 #include "chrome/views/controls/text_field.h" | 28 #include "chrome/views/controls/text_field.h" |
| 28 #include "chrome/views/view.h" | 29 #include "chrome/views/view.h" |
| 29 | 30 |
| 30 #include "grit/debugger_resources.h" | 31 #include "grit/debugger_resources.h" |
| 31 | 32 |
| 32 DebuggerView::DebuggerView(DebuggerWindow* window) | 33 DebuggerView::DebuggerView(DebuggerWindow* window) |
| 33 : window_(window), output_ready_(false) { | 34 : window_(window), output_ready_(false) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void DebuggerView::OnInit() { | 98 void DebuggerView::OnInit() { |
| 98 // We can't create the TabContents until we've actually been put into a real | 99 // We can't create the TabContents until we've actually been put into a real |
| 99 // view hierarchy somewhere. | 100 // view hierarchy somewhere. |
| 100 Profile* profile = BrowserList::GetLastActive()->profile(); | 101 Profile* profile = BrowserList::GetLastActive()->profile(); |
| 101 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 102 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); |
| 102 | 103 |
| 103 tab_contents_->set_delegate(this); | 104 tab_contents_->set_delegate(this); |
| 104 web_container_->SetTabContents(tab_contents_); | 105 web_container_->SetTabContents(tab_contents_); |
| 105 tab_contents_->render_view_host()->AllowDOMUIBindings(); | 106 tab_contents_->render_view_host()->AllowDOMUIBindings(); |
| 106 | 107 |
| 107 GURL contents("chrome-ui://inspector/debugger.html"); | 108 GURL contents(std::string(chrome::kChromeUIScheme) + |
| 109 "//inspector/debugger.html"); |
| 108 tab_contents_->controller().LoadURL(contents, GURL(), | 110 tab_contents_->controller().LoadURL(contents, GURL(), |
| 109 PageTransition::START_PAGE); | 111 PageTransition::START_PAGE); |
| 110 } | 112 } |
| 111 | 113 |
| 112 void DebuggerView::OnShow() { | 114 void DebuggerView::OnShow() { |
| 113 tab_contents_->Focus(); | 115 tab_contents_->Focus(); |
| 114 } | 116 } |
| 115 | 117 |
| 116 void DebuggerView::OnClose() { | 118 void DebuggerView::OnClose() { |
| 117 web_container_->SetTabContents(NULL); | 119 web_container_->SetTabContents(NULL); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void DebuggerView::LoadingStateChanged(TabContents* source) { | 157 void DebuggerView::LoadingStateChanged(TabContents* source) { |
| 156 if (!source->is_loading()) | 158 if (!source->is_loading()) |
| 157 SetOutputViewReady(); | 159 SetOutputViewReady(); |
| 158 } | 160 } |
| 159 | 161 |
| 160 bool DebuggerView::AcceleratorPressed(const views::Accelerator& accelerator) { | 162 bool DebuggerView::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 161 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); | 163 DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); |
| 162 window_->window()->Close(); | 164 window_->window()->Close(); |
| 163 return true; | 165 return true; |
| 164 } | 166 } |
| OLD | NEW |