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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 6159001: Modifying some downloads hooks to act per-window (so that incognito windows c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/functional/downloads.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/testing_automation_provider.cc
===================================================================
--- chrome/browser/automation/testing_automation_provider.cc (revision 71402)
+++ chrome/browser/automation/testing_automation_provider.cc (working copy)
@@ -2521,14 +2521,15 @@
IPC::Message* reply_message) {
AutomationJSONReply reply(this, reply_message);
- if (!profile_->HasCreatedDownloadManager()) {
+ if (!browser->profile()->HasCreatedDownloadManager()) {
reply.SendError("no download manager");
return;
}
scoped_ptr<DictionaryValue> return_value(new DictionaryValue);
std::vector<DownloadItem*> downloads;
- profile_->GetDownloadManager()->GetAllDownloads(FilePath(), &downloads);
+ browser->profile()->GetDownloadManager()->
+ GetAllDownloads(FilePath(), &downloads);
ListValue* list_of_downloads = new ListValue;
for (std::vector<DownloadItem*>::iterator it = downloads.begin();
@@ -2548,18 +2549,18 @@
IPC::Message* reply_message) {
// Look for a quick return.
- if (!profile_->HasCreatedDownloadManager()) {
+ if (!browser->profile()->HasCreatedDownloadManager()) {
// No download manager.
AutomationJSONReply(this, reply_message).SendSuccess(NULL);
return;
}
std::vector<DownloadItem*> downloads;
- profile_->GetDownloadManager()->GetCurrentDownloads(FilePath(), &downloads);
+ browser->profile()->GetDownloadManager()->
+ GetCurrentDownloads(FilePath(), &downloads);
if (downloads.empty()) {
AutomationJSONReply(this, reply_message).SendSuccess(NULL);
return;
}
-
// The observer owns itself. When the last observed item pings, it
// deletes itself.
AutomationProviderDownloadItemObserver* item_observer =
@@ -2602,7 +2603,7 @@
int id;
std::string action;
- if (!profile_->HasCreatedDownloadManager()) {
+ if (!browser->profile()->HasCreatedDownloadManager()) {
AutomationJSONReply(this, reply_message).SendError("No download manager.");
return;
}
@@ -2612,7 +2613,7 @@
return;
}
- DownloadManager* download_manager = profile_->GetDownloadManager();
+ DownloadManager* download_manager = browser->profile()->GetDownloadManager();
DownloadItem* selected_item = GetDownloadItemFromId(id, download_manager);
if (!selected_item) {
AutomationJSONReply(this, reply_message).SendError(
« no previous file with comments | « no previous file | chrome/test/functional/downloads.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698