Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 DCHECK(parent); | 297 DCHECK(parent); |
| 298 return chrome::GetIndexOfTab(parent, controller->GetWebContents()); | 298 return chrome::GetIndexOfTab(parent, controller->GetWebContents()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 // TODO(phajdan.jr): move to TestingAutomationProvider. | 301 // TODO(phajdan.jr): move to TestingAutomationProvider. |
| 302 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( | 302 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( |
| 303 const DownloadItem* download) { | 303 const DownloadItem* download) { |
| 304 std::map<DownloadItem::DownloadState, std::string> state_to_string; | 304 std::map<DownloadItem::DownloadState, std::string> state_to_string; |
| 305 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); | 305 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); |
| 306 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); | 306 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); |
| 307 state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); | |
|
Randy Smith (Not in Mondays)
2012/07/11 17:55:37
Can you say a word or two about why you don't thin
benjhayden
2012/07/13 20:03:17
grep -i REMOVING $(find . -iname '*.py'|grep downl
Randy Smith (Not in Mondays)
2012/07/14 19:25:53
And you're comfortable that the pyauto tests are t
benjhayden
2012/07/23 15:43:09
ui_unittests and interactive_ui_tests pass on all
| |
| 308 state_to_string[DownloadItem::INTERRUPTED] = std::string("INTERRUPTED"); | 307 state_to_string[DownloadItem::INTERRUPTED] = std::string("INTERRUPTED"); |
| 309 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); | 308 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); |
| 310 | 309 |
| 311 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; | 310 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; |
| 312 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); | 311 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); |
| 313 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); | 312 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); |
| 314 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = | 313 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = |
| 315 std::string("DANGEROUS_BUT_VALIDATED"); | 314 std::string("DANGEROUS_BUT_VALIDATED"); |
| 316 | 315 |
| 317 DictionaryValue* dl_item_value = new DictionaryValue; | 316 DictionaryValue* dl_item_value = new DictionaryValue; |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 750 | 749 |
| 751 return NULL; | 750 return NULL; |
| 752 } | 751 } |
| 753 | 752 |
| 754 void AutomationProvider::SaveAsAsync(int tab_handle) { | 753 void AutomationProvider::SaveAsAsync(int tab_handle) { |
| 755 NavigationController* tab = NULL; | 754 NavigationController* tab = NULL; |
| 756 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 755 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
| 757 if (web_contents) | 756 if (web_contents) |
| 758 web_contents->OnSavePage(); | 757 web_contents->OnSavePage(); |
| 759 } | 758 } |
| OLD | NEW |