| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 42     DCHECK(GetWidget()); | 42     DCHECK(GetWidget()); | 
| 43     Init(); | 43     Init(); | 
| 44   } | 44   } | 
| 45 } | 45 } | 
| 46 | 46 | 
| 47 void DevToolsView::Init() { | 47 void DevToolsView::Init() { | 
| 48   // We can't create the WebContents until we've actually been put into a real | 48   // We can't create the WebContents 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   TabContents* tc = TabContents::CreateWithType(TAB_CONTENTS_WEB, profile, | 52   web_contents_ = new WebContents(profile, NULL, MSG_ROUTING_NONE, NULL); | 
| 53                                                 NULL, NULL); |  | 
| 54   web_contents_ = tc->AsWebContents(); |  | 
| 55   web_contents_->SetupController(profile); | 53   web_contents_->SetupController(profile); | 
| 56   web_contents_->set_delegate(this); | 54   web_contents_->set_delegate(this); | 
| 57   web_container_->SetTabContents(web_contents_); | 55   web_container_->SetTabContents(web_contents_); | 
| 58   web_contents_->render_view_host()->AllowDOMUIBindings(); | 56   web_contents_->render_view_host()->AllowDOMUIBindings(); | 
| 59 | 57 | 
| 60   // chrome-ui://devtools/devtools.html | 58   // chrome-ui://devtools/devtools.html | 
| 61   GURL contents(std::string(chrome::kChromeUIDevToolsURL) + "devtools.html"); | 59   GURL contents(std::string(chrome::kChromeUIDevToolsURL) + "devtools.html"); | 
| 62 | 60 | 
| 63   // this will call CreateRenderView to create renderer process | 61   // this will call CreateRenderView to create renderer process | 
| 64   web_contents_->controller()->LoadURL(contents, GURL(), | 62   web_contents_->controller()->LoadURL(contents, GURL(), | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 92   } | 90   } | 
| 93   return false; | 91   return false; | 
| 94 } | 92 } | 
| 95 | 93 | 
| 96 void DevToolsView::OpenURLFromTab(TabContents* source, | 94 void DevToolsView::OpenURLFromTab(TabContents* source, | 
| 97                                const GURL& url, const GURL& referrer, | 95                                const GURL& url, const GURL& referrer, | 
| 98                                WindowOpenDisposition disposition, | 96                                WindowOpenDisposition disposition, | 
| 99                                PageTransition::Type transition) { | 97                                PageTransition::Type transition) { | 
| 100   NOTREACHED(); | 98   NOTREACHED(); | 
| 101 } | 99 } | 
| OLD | NEW | 
|---|