OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return extension_tracker_->Add(extension); | 256 return extension_tracker_->Add(extension); |
257 } | 257 } |
258 | 258 |
259 // TODO(phajdan.jr): move to TestingAutomationProvider. | 259 // TODO(phajdan.jr): move to TestingAutomationProvider. |
260 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( | 260 DictionaryValue* AutomationProvider::GetDictionaryFromDownloadItem( |
261 const DownloadItem* download) { | 261 const DownloadItem* download) { |
262 std::map<DownloadItem::DownloadState, std::string> state_to_string; | 262 std::map<DownloadItem::DownloadState, std::string> state_to_string; |
263 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); | 263 state_to_string[DownloadItem::IN_PROGRESS] = std::string("IN_PROGRESS"); |
264 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); | 264 state_to_string[DownloadItem::CANCELLED] = std::string("CANCELLED"); |
265 state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); | 265 state_to_string[DownloadItem::REMOVING] = std::string("REMOVING"); |
| 266 state_to_string[DownloadItem::INTERRUPTED] = std::string("INTERRUPTED"); |
266 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); | 267 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); |
267 | 268 |
268 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; | 269 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; |
269 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); | 270 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); |
270 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); | 271 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); |
271 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = | 272 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = |
272 std::string("DANGEROUS_BUT_VALIDATED"); | 273 std::string("DANGEROUS_BUT_VALIDATED"); |
273 | 274 |
274 DictionaryValue* dl_item_value = new DictionaryValue; | 275 DictionaryValue* dl_item_value = new DictionaryValue; |
275 dl_item_value->SetInteger("id", static_cast<int>(download->id())); | 276 dl_item_value->SetInteger("id", static_cast<int>(download->id())); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 } | 957 } |
957 } | 958 } |
958 } | 959 } |
959 | 960 |
960 void AutomationProvider::SaveAsAsync(int tab_handle) { | 961 void AutomationProvider::SaveAsAsync(int tab_handle) { |
961 NavigationController* tab = NULL; | 962 NavigationController* tab = NULL; |
962 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); | 963 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); |
963 if (tab_contents) | 964 if (tab_contents) |
964 tab_contents->OnSavePage(); | 965 tab_contents->OnSavePage(); |
965 } | 966 } |
OLD | NEW |