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

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: 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
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 =
144 Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
144 if (!profile) 145 if (!profile)
145 return; 146 return;
146 DevToolsWindow* window = DevToolsWindow::CreateDevToolsWindowForWorker( 147 DevToolsWindow* window = DevToolsWindow::CreateDevToolsWindowForWorker(
147 profile); 148 profile);
148 window->Show(DEVTOOLS_TOGGLE_ACTION_NONE); 149 window->Show(DEVTOOLS_TOGGLE_ACTION_NONE);
149 WorkerDevToolsManagerIO::RegisterDevToolsClientForWorkerOnUIThread( 150 WorkerDevToolsManagerIO::RegisterDevToolsClientForWorkerOnUIThread(
150 window, 151 window,
151 worker_process_host_id, 152 worker_process_host_id,
152 worker_route_id); 153 worker_route_id);
153 } 154 }
154 155
155 } // namespace 156 } // namespace
156 157
157 WorkersUI::WorkersUI(TabContents* contents) : ChromeWebUI(contents) { 158 WorkersUI::WorkersUI(TabContents* contents) : ChromeWebUI(contents) {
158 WorkersDOMHandler* handler = new WorkersDOMHandler(); 159 WorkersDOMHandler* handler = new WorkersDOMHandler();
159 AddMessageHandler(handler); 160 AddMessageHandler(handler);
160 handler->Attach(this); 161 handler->Attach(this);
161 162
162 WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource(); 163 WorkersUIHTMLSource* html_source = new WorkersUIHTMLSource();
163 164
164 // Set up the chrome://workers/ source. 165 // Set up the chrome://workers/ source.
165 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 166 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
166 profile->GetChromeURLDataManager()->AddDataSource(html_source); 167 profile->GetChromeURLDataManager()->AddDataSource(html_source);
167 } 168 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698