OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/devtools_ui.h" | 5 #include "chrome/browser/ui/webui/devtools_ui.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/net/chrome_url_request_context.h" | 9 #include "chrome/browser/net/chrome_url_request_context.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return "text/plain"; | 84 return "text/plain"; |
85 } | 85 } |
86 | 86 |
87 // static | 87 // static |
88 void DevToolsUI::RegisterDevToolsDataSource() { | 88 void DevToolsUI::RegisterDevToolsDataSource() { |
89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
90 static bool registered = false; | 90 static bool registered = false; |
91 if (!registered) { | 91 if (!registered) { |
92 DevToolsDataSource* data_source = new DevToolsDataSource(); | 92 DevToolsDataSource* data_source = new DevToolsDataSource(); |
93 ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>( | 93 ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>( |
94 Profile::GetDefaultRequestContext()->GetURLRequestContext()); | 94 Profile::Deprecated::GetDefaultRequestContext()-> |
| 95 GetURLRequestContext()); |
95 context->chrome_url_data_manager_backend()->AddDataSource(data_source); | 96 context->chrome_url_data_manager_backend()->AddDataSource(data_source); |
96 registered = true; | 97 registered = true; |
97 } | 98 } |
98 } | 99 } |
99 | 100 |
100 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { | 101 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { |
101 DevToolsDataSource* data_source = new DevToolsDataSource(); | 102 DevToolsDataSource* data_source = new DevToolsDataSource(); |
102 contents->profile()->GetChromeURLDataManager()->AddDataSource(data_source); | 103 contents->profile()->GetChromeURLDataManager()->AddDataSource(data_source); |
103 } | 104 } |
104 | 105 |
105 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { | 106 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { |
106 render_view_host->Send(new DevToolsMsg_SetupDevToolsClient( | 107 render_view_host->Send(new DevToolsMsg_SetupDevToolsClient( |
107 render_view_host->routing_id())); | 108 render_view_host->routing_id())); |
108 } | 109 } |
OLD | NEW |