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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 DCHECK(parent); | 296 DCHECK(parent); |
297 return parent->GetIndexOfController(controller); | 297 return parent->GetIndexOfController(controller); |
298 } | 298 } |
299 | 299 |
300 // TODO(phajdan.jr): move to TestingAutomationProvider. | 300 // TODO(phajdan.jr): move to TestingAutomationProvider. |
301 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( | 301 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( |
302 const DownloadItem* download) { | 302 const DownloadItem* download) { |
303 std::map<DownloadItem::DownloadState, std::string> state_to_string; | 303 std::map<DownloadItem::DownloadState, std::string> state_to_string; |
304 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); | 304 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); |
305 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); | 305 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); |
306 state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); | |
307 state_to_string[DownloadItem::INTERRUPTED] = std::string("INTERRUPTED"); | 306 state_to_string[DownloadItem::INTERRUPTED] = std::string("INTERRUPTED"); |
308 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); | 307 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); |
309 | 308 |
310 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; | 309 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; |
311 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); | 310 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); |
312 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); | 311 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); |
313 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = | 312 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = |
314 std::string("DANGEROUS_BUT_VALIDATED"); | 313 std::string("DANGEROUS_BUT_VALIDATED"); |
315 | 314 |
316 DictionaryValue* dl_item_value = new DictionaryValue; | 315 DictionaryValue* dl_item_value = new DictionaryValue; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 748 |
750 return NULL; | 749 return NULL; |
751 } | 750 } |
752 | 751 |
753 void AutomationProvider::SaveAsAsync(int tab_handle) { | 752 void AutomationProvider::SaveAsAsync(int tab_handle) { |
754 NavigationController* tab = NULL; | 753 NavigationController* tab = NULL; |
755 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); | 754 WebContents* web_contents = GetWebContentsForHandle(tab_handle, &tab); |
756 if (web_contents) | 755 if (web_contents) |
757 web_contents->OnSavePage(); | 756 web_contents->OnSavePage(); |
758 } | 757 } |
OLD | NEW |