| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 NOTREACHED(); | 85 NOTREACHED(); |
| 86 return "text/plain"; | 86 return "text/plain"; |
| 87 } | 87 } |
| 88 | 88 |
| 89 // static | 89 // static |
| 90 void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) { | 90 void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) { |
| 91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 92 static bool registered = false; | 92 static bool registered = false; |
| 93 if (!registered) { | 93 if (!registered) { |
| 94 DevToolsDataSource* data_source = new DevToolsDataSource(); | 94 DevToolsDataSource* data_source = new DevToolsDataSource(); |
| 95 profile->GetChromeURLDataManager()->AddDataSource(data_source); | 95 ChromeURLDataManager::AddDataSource(profile, data_source); |
| 96 registered = true; | 96 registered = true; |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 DevToolsUI::DevToolsUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 100 DevToolsUI::DevToolsUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 101 DevToolsDataSource* data_source = new DevToolsDataSource(); | 101 DevToolsDataSource* data_source = new DevToolsDataSource(); |
| 102 Profile* profile = Profile::FromWebUI(web_ui); | 102 Profile* profile = Profile::FromWebUI(web_ui); |
| 103 profile->GetChromeURLDataManager()->AddDataSource(data_source); | 103 ChromeURLDataManager::AddDataSource(profile, data_source); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void DevToolsUI::RenderViewCreated( | 106 void DevToolsUI::RenderViewCreated( |
| 107 content::RenderViewHost* render_view_host) { | 107 content::RenderViewHost* render_view_host) { |
| 108 content::DevToolsClientHost::SetupDevToolsFrontendClient(render_view_host); | 108 content::DevToolsClientHost::SetupDevToolsFrontendClient(render_view_host); |
| 109 } | 109 } |
| OLD | NEW |