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

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 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after
3504 if (!tab_contents->SavePage( 3504 if (!tab_contents->SavePage(
3505 FilePath(filename), 3505 FilePath(filename),
3506 FilePath(parent_directory), 3506 FilePath(parent_directory),
3507 SavePackage::SAVE_AS_ONLY_HTML)) { 3507 SavePackage::SAVE_AS_ONLY_HTML)) {
3508 AutomationJSONReply(this, reply_message).SendError( 3508 AutomationJSONReply(this, reply_message).SendError(
3509 "Could not initiate SavePage"); 3509 "Could not initiate SavePage");
3510 return; 3510 return;
3511 } 3511 }
3512 // The observer will delete itself when done. 3512 // The observer will delete itself when done.
3513 new SavePackageNotificationObserver( 3513 new SavePackageNotificationObserver(
3514 tab_contents->save_package(), this, reply_message); 3514 browser->profile()->GetDownloadManager(), this, reply_message);
3515 } 3515 }
3516 3516
3517 // Refer to ImportSettings() in chrome/test/pyautolib/pyauto.py for sample 3517 // Refer to ImportSettings() in chrome/test/pyautolib/pyauto.py for sample
3518 // json input. 3518 // json input.
3519 // Sample json output: "{}" 3519 // Sample json output: "{}"
3520 void TestingAutomationProvider::ImportSettings(Browser* browser, 3520 void TestingAutomationProvider::ImportSettings(Browser* browser,
3521 DictionaryValue* args, 3521 DictionaryValue* args,
3522 IPC::Message* reply_message) { 3522 IPC::Message* reply_message) {
3523 // Map from the json string passed over to the import item masks. 3523 // Map from the json string passed over to the import item masks.
3524 std::map<std::string, importer::ImportItem> string_to_import_item; 3524 std::map<std::string, importer::ImportItem> string_to_import_item;
(...skipping 2615 matching lines...) Expand 10 before | Expand all | Expand 10 after
6140 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); 6140 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl);
6141 6141
6142 Send(reply_message_); 6142 Send(reply_message_);
6143 redirect_query_ = 0; 6143 redirect_query_ = 0;
6144 reply_message_ = NULL; 6144 reply_message_ = NULL;
6145 } 6145 }
6146 6146
6147 void TestingAutomationProvider::OnRemoveProvider() { 6147 void TestingAutomationProvider::OnRemoveProvider() {
6148 AutomationProviderList::GetInstance()->RemoveProvider(this); 6148 AutomationProviderList::GetInstance()->RemoveProvider(this);
6149 } 6149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698