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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 7277073: Support for adding save page download items into downloads history. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3510 matching lines...) Expand 10 before | Expand all | Expand 10 after
3521 if (!tab_contents->SavePage( 3521 if (!tab_contents->SavePage(
3522 FilePath(filename), 3522 FilePath(filename),
3523 FilePath(parent_directory), 3523 FilePath(parent_directory),
3524 SavePackage::SAVE_AS_ONLY_HTML)) { 3524 SavePackage::SAVE_AS_ONLY_HTML)) {
3525 AutomationJSONReply(this, reply_message).SendError( 3525 AutomationJSONReply(this, reply_message).SendError(
3526 "Could not initiate SavePage"); 3526 "Could not initiate SavePage");
3527 return; 3527 return;
3528 } 3528 }
3529 // The observer will delete itself when done. 3529 // The observer will delete itself when done.
3530 new SavePackageNotificationObserver( 3530 new SavePackageNotificationObserver(
3531 tab_contents->save_package(), this, reply_message); 3531 browser->profile()->GetDownloadManager(), this, reply_message);
3532 } 3532 }
3533 3533
3534 // Refer to ImportSettings() in chrome/test/pyautolib/pyauto.py for sample 3534 // Refer to ImportSettings() in chrome/test/pyautolib/pyauto.py for sample
3535 // json input. 3535 // json input.
3536 // Sample json output: "{}" 3536 // Sample json output: "{}"
3537 void TestingAutomationProvider::ImportSettings(Browser* browser, 3537 void TestingAutomationProvider::ImportSettings(Browser* browser,
3538 DictionaryValue* args, 3538 DictionaryValue* args,
3539 IPC::Message* reply_message) { 3539 IPC::Message* reply_message) {
3540 // Map from the json string passed over to the import item masks. 3540 // Map from the json string passed over to the import item masks.
3541 std::map<std::string, importer::ImportItem> string_to_import_item; 3541 std::map<std::string, importer::ImportItem> string_to_import_item;
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
6157 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); 6157 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl);
6158 6158
6159 Send(reply_message_); 6159 Send(reply_message_);
6160 redirect_query_ = 0; 6160 redirect_query_ = 0;
6161 reply_message_ = NULL; 6161 reply_message_ = NULL;
6162 } 6162 }
6163 6163
6164 void TestingAutomationProvider::OnRemoveProvider() { 6164 void TestingAutomationProvider::OnRemoveProvider() {
6165 AutomationProviderList::GetInstance()->RemoveProvider(this); 6165 AutomationProviderList::GetInstance()->RemoveProvider(this);
6166 } 6166 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.cc ('k') | chrome/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698