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 <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" |
11 #include "chrome/browser/net/chrome_url_request_context.h" | 11 #include "chrome/browser/net/chrome_url_request_context.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 13 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/tab_contents/tab_contents.h" | 16 #include "content/browser/tab_contents/tab_contents.h" |
17 #include "content/common/devtools_messages.h" | 17 #include "content/common/devtools_messages.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "grit/devtools_resources_map.h" | 19 #include "grit/devtools_resources_map.h" |
20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
21 | 21 |
| 22 using content::BrowserThread; |
| 23 |
22 namespace { | 24 namespace { |
23 | 25 |
24 std::string PathWithoutParams(const std::string& path) { | 26 std::string PathWithoutParams(const std::string& path) { |
25 return GURL(std::string("chrome-devtools://devtools/") + path) | 27 return GURL(std::string("chrome-devtools://devtools/") + path) |
26 .path().substr(1); | 28 .path().substr(1); |
27 } | 29 } |
28 | 30 |
29 } // namespace | 31 } // namespace |
30 | 32 |
31 class DevToolsDataSource : public ChromeURLDataManager::DataSource { | 33 class DevToolsDataSource : public ChromeURLDataManager::DataSource { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { | 102 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { |
101 DevToolsDataSource* data_source = new DevToolsDataSource(); | 103 DevToolsDataSource* data_source = new DevToolsDataSource(); |
102 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); | 104 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); |
103 profile->GetChromeURLDataManager()->AddDataSource(data_source); | 105 profile->GetChromeURLDataManager()->AddDataSource(data_source); |
104 } | 106 } |
105 | 107 |
106 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { | 108 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { |
107 render_view_host->Send(new DevToolsMsg_SetupDevToolsClient( | 109 render_view_host->Send(new DevToolsMsg_SetupDevToolsClient( |
108 render_view_host->routing_id())); | 110 render_view_host->routing_id())); |
109 } | 111 } |
OLD | NEW |