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

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

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase Created 9 years, 4 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/web_ui_test_handler.cc ('k') | content/browser/webui/web_ui.h » ('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/workers_ui.h" 5 #include "chrome/browser/ui/webui/workers_ui.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 CHECK(args->GetSize() == 2); 133 CHECK(args->GetSize() == 2);
134 CHECK(args->GetString(0, &worker_process_host_id_str)); 134 CHECK(args->GetString(0, &worker_process_host_id_str));
135 CHECK(args->GetString(1, &worker_route_id_str)); 135 CHECK(args->GetString(1, &worker_route_id_str));
136 CHECK(base::StringToInt(worker_process_host_id_str, 136 CHECK(base::StringToInt(worker_process_host_id_str,
137 &worker_process_host_id)); 137 &worker_process_host_id));
138 CHECK(base::StringToInt(worker_route_id_str, &worker_route_id)); 138 CHECK(base::StringToInt(worker_route_id_str, &worker_route_id));
139 139
140 if (WorkerDevToolsManagerIO::HasDevToolsClient(worker_process_host_id, 140 if (WorkerDevToolsManagerIO::HasDevToolsClient(worker_process_host_id,
141 worker_route_id)) 141 worker_route_id))
142 return; 142 return;
143 Profile* profile = web_ui_->GetProfile(); 143 Profile* profile = Profile::FromWebUI(web_ui_);
144 if (!profile) 144 if (!profile)
145 return; 145 return;
146 DevToolsWindow* window = DevToolsWindow::CreateDevToolsWindowForWorker( 146 DevToolsWindow* window = DevToolsWindow::CreateDevToolsWindowForWorker(
147 profile); 147 profile);
148 window->Show(DEVTOOLS_TOGGLE_ACTION_NONE); 148 window->Show(DEVTOOLS_TOGGLE_ACTION_NONE);
149 WorkerDevToolsManagerIO::RegisterDevToolsClientForWorkerOnUIThread( 149 WorkerDevToolsManagerIO::RegisterDevToolsClientForWorkerOnUIThread(
150 window, 150 window,
151 worker_process_host_id, 151 worker_process_host_id,
152 worker_route_id); 152 worker_route_id);
153 } 153 }
154 154
155 } // namespace 155 } // namespace
156 156
157 WorkersUI::WorkersUI(TabContents* contents) : ChromeWebUI(contents) { 157 WorkersUI::WorkersUI(TabContents* contents) : ChromeWebUI(contents) {
158 WorkersDOMHandler* handler = new WorkersDOMHandler(); 158 WorkersDOMHandler* handler = new WorkersDOMHandler();
159 AddMessageHandler(handler); 159 AddMessageHandler(handler);
160 handler->Attach(this); 160 handler->Attach(this);
161 161
162 WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource(); 162 WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource();
163 163
164 // Set up the chrome://workers/ source. 164 // Set up the chrome://workers/ source.
165 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 165 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
166 profile->GetChromeURLDataManager()->AddDataSource(html_source); 166 profile->GetChromeURLDataManager()->AddDataSource(html_source);
167 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_ui_test_handler.cc ('k') | content/browser/webui/web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698