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

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

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months 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
« no previous file with comments | « chrome/browser/ui/webui/devtools_ui.h ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
17 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/devtools_client_host.h" 17 #include "content/public/browser/devtools_client_host.h"
18 #include "content/public/browser/web_contents.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 using content::WebContents;
23 24
24 namespace { 25 namespace {
25 26
26 std::string PathWithoutParams(const std::string& path) { 27 std::string PathWithoutParams(const std::string& path) {
27 return GURL(std::string("chrome-devtools://devtools/") + path) 28 return GURL(std::string("chrome-devtools://devtools/") + path)
28 .path().substr(1); 29 .path().substr(1);
29 } 30 }
30 31
31 } // namespace 32 } // namespace
32 33
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) { 93 void DevToolsUI::RegisterDevToolsDataSource(Profile* profile) {
93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
94 static bool registered = false; 95 static bool registered = false;
95 if (!registered) { 96 if (!registered) {
96 DevToolsDataSource* data_source = new DevToolsDataSource(); 97 DevToolsDataSource* data_source = new DevToolsDataSource();
97 profile->GetChromeURLDataManager()->AddDataSource(data_source); 98 profile->GetChromeURLDataManager()->AddDataSource(data_source);
98 registered = true; 99 registered = true;
99 } 100 }
100 } 101 }
101 102
102 DevToolsUI::DevToolsUI(TabContents* contents) : ChromeWebUI(contents) { 103 DevToolsUI::DevToolsUI(WebContents* contents) : ChromeWebUI(contents) {
103 DevToolsDataSource* data_source = new DevToolsDataSource(); 104 DevToolsDataSource* data_source = new DevToolsDataSource();
104 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 105 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
105 profile->GetChromeURLDataManager()->AddDataSource(data_source); 106 profile->GetChromeURLDataManager()->AddDataSource(data_source);
106 } 107 }
107 108
108 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) { 109 void DevToolsUI::RenderViewCreated(RenderViewHost* render_view_host) {
109 content::DevToolsClientHost::SetupDevToolsFrontendClient(render_view_host); 110 content::DevToolsClientHost::SetupDevToolsFrontendClient(render_view_host);
110 ChromeWebUI::RenderViewCreated(render_view_host); 111 ChromeWebUI::RenderViewCreated(render_view_host);
111 } 112 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/devtools_ui.h ('k') | chrome/browser/ui/webui/downloads_dom_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698