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

Side by Side Diff: chrome/browser/ui/webui/active_downloads_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/profiles/profile.cc ('k') | chrome/browser/ui/webui/bug_report_ui.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/active_downloads_ui.h" 5 #include "chrome/browser/ui/webui/active_downloads_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 ActiveDownloadsHandler::~ActiveDownloadsHandler() { 205 ActiveDownloadsHandler::~ActiveDownloadsHandler() {
206 for (size_t i = 0; i < downloads_.size(); ++i) { 206 for (size_t i = 0; i < downloads_.size(); ++i) {
207 downloads_[i]->RemoveObserver(this); 207 downloads_[i]->RemoveObserver(this);
208 } 208 }
209 download_manager_->RemoveObserver(this); 209 download_manager_->RemoveObserver(this);
210 } 210 }
211 211
212 WebUIMessageHandler* ActiveDownloadsHandler::Attach(WebUI* web_ui) { 212 WebUIMessageHandler* ActiveDownloadsHandler::Attach(WebUI* web_ui) {
213 profile_ = web_ui->GetProfile(); 213 profile_ = Profile::FromWebUI(web_ui);
214 profile_->GetChromeURLDataManager()->AddDataSource(new FileIconSourceCros()); 214 profile_->GetChromeURLDataManager()->AddDataSource(new FileIconSourceCros());
215 tab_contents_ = web_ui->tab_contents(); 215 tab_contents_ = web_ui->tab_contents();
216 return WebUIMessageHandler::Attach(web_ui); 216 return WebUIMessageHandler::Attach(web_ui);
217 } 217 }
218 218
219 void ActiveDownloadsHandler::Init() { 219 void ActiveDownloadsHandler::Init() {
220 download_manager_ = profile_->GetDownloadManager(); 220 download_manager_ = profile_->GetDownloadManager();
221 download_manager_->AddObserver(this); 221 download_manager_->AddObserver(this);
222 } 222 }
223 223
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 return (*it); 430 return (*it);
431 } 431 }
432 } 432 }
433 } 433 }
434 return NULL; 434 return NULL;
435 } 435 }
436 436
437 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { 437 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const {
438 return handler_->downloads(); 438 return handler_->downloads();
439 } 439 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/ui/webui/bug_report_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698