| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/devtools_view.h" | 5 #include "chrome/browser/debugger/devtools_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 10 #include "chrome/browser/debugger/devtools_client_host.h" | 10 #include "chrome/browser/debugger/devtools_client_host.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 void DevToolsView::Init() { | 47 void DevToolsView::Init() { |
| 48 // We can't create the TabContents until we've actually been put into a real | 48 // We can't create the TabContents until we've actually been put into a real |
| 49 // view hierarchy somewhere. | 49 // view hierarchy somewhere. |
| 50 Profile* profile = BrowserList::GetLastActive()->profile(); | 50 Profile* profile = BrowserList::GetLastActive()->profile(); |
| 51 | 51 |
| 52 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 52 tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); |
| 53 tab_contents_->set_delegate(this); | 53 tab_contents_->set_delegate(this); |
| 54 web_container_->SetTabContents(tab_contents_); | 54 web_container_->SetTabContents(tab_contents_); |
| 55 tab_contents_->render_view_host()->AllowDOMUIBindings(); | 55 tab_contents_->render_view_host()->AllowDOMUIBindings(); |
| 56 | 56 |
| 57 // chrome-ui://devtools/devtools.html | 57 // chrome://devtools/devtools.html |
| 58 GURL contents(std::string(chrome::kChromeUIDevToolsURL) + "devtools.html"); | 58 GURL contents(std::string(chrome::kChromeUIDevToolsURL) + "devtools.html"); |
| 59 | 59 |
| 60 // this will call CreateRenderView to create renderer process | 60 // this will call CreateRenderView to create renderer process |
| 61 tab_contents_->controller().LoadURL(contents, GURL(), | 61 tab_contents_->controller().LoadURL(contents, GURL(), |
| 62 PageTransition::START_PAGE); | 62 PageTransition::START_PAGE); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void DevToolsView::OnWindowClosing() { | 65 void DevToolsView::OnWindowClosing() { |
| 66 DCHECK(tab_contents_) << "OnWindowClosing is called twice"; | 66 DCHECK(tab_contents_) << "OnWindowClosing is called twice"; |
| 67 if (tab_contents_) { | 67 if (tab_contents_) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 89 } | 89 } |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void DevToolsView::OpenURLFromTab(TabContents* source, | 93 void DevToolsView::OpenURLFromTab(TabContents* source, |
| 94 const GURL& url, const GURL& referrer, | 94 const GURL& url, const GURL& referrer, |
| 95 WindowOpenDisposition disposition, | 95 WindowOpenDisposition disposition, |
| 96 PageTransition::Type transition) { | 96 PageTransition::Type transition) { |
| 97 NOTREACHED(); | 97 NOTREACHED(); |
| 98 } | 98 } |
| OLD | NEW |