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