Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Side by Side Diff: chrome/browser/ui/webui/devtools_ui.cc

Issue 8549022: Define DevTools content API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
18 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/devtools_client_host.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; 22 using content::BrowserThread;
23 23
24 namespace { 24 namespace {
25 25
26 std::string PathWithoutParams(const std::string& path) { 26 std::string PathWithoutParams(const std::string& path) {
27 return GURL(std::string("chrome-devtools://devtools/") + path) 27 return GURL(std::string("chrome-devtools://devtools/") + path)
28 .path().substr(1); 28 .path().substr(1);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 } 100 }
101 101
102 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { 102 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) {
103 DevToolsDataSource* data_source = new DevToolsDataSource(); 103 DevToolsDataSource* data_source = new DevToolsDataSource();
104 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 104 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
105 profile->GetChromeURLDataManager()->AddDataSource(data_source); 105 profile->GetChromeURLDataManager()->AddDataSource(data_source);
106 } 106 }
107 107
108 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { 108 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) {
109 render_view_host->Send(new DevToolsMsg_SetupDevToolsClient( 109 content::DevToolsClientHost::SetupDevToolsFrontendClient(render_view_host);
110 render_view_host->routing_id()));
111 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698