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

Side by Side Diff: chrome/browser/automation/automation_provider.cc

Issue 10665049: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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) 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
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");
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_download_observer.h » ('j') | chrome/browser/download/download_history.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698