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

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

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stupid clang! Created 9 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE"); 245 state_to_string[DownloadItem::COMPLETE] = std::string("COMPLETE");
246 246
247 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string; 247 std::map<DownloadItem::SafetyState, std::string> safety_state_to_string;
248 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE"); 248 safety_state_to_string[DownloadItem::SAFE] = std::string("SAFE");
249 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS"); 249 safety_state_to_string[DownloadItem::DANGEROUS] = std::string("DANGEROUS");
250 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] = 250 safety_state_to_string[DownloadItem::DANGEROUS_BUT_VALIDATED] =
251 std::string("DANGEROUS_BUT_VALIDATED"); 251 std::string("DANGEROUS_BUT_VALIDATED");
252 252
253 DictionaryValue* dl_item_value = new DictionaryValue; 253 DictionaryValue* dl_item_value = new DictionaryValue;
254 dl_item_value->SetInteger("id", static_cast<int>(download->id())); 254 dl_item_value->SetInteger("id", static_cast<int>(download->id()));
255 dl_item_value->SetString("url", download->url().spec()); 255 dl_item_value->SetString("url", download->GetURL().spec());
256 dl_item_value->SetString("referrer_url", download->referrer_url().spec()); 256 dl_item_value->SetString("referrer_url", download->referrer_url().spec());
257 dl_item_value->SetString("file_name", 257 dl_item_value->SetString("file_name",
258 download->GetFileNameToReportUser().value()); 258 download->GetFileNameToReportUser().value());
259 dl_item_value->SetString("full_path", 259 dl_item_value->SetString("full_path",
260 download->GetTargetFilePath().value()); 260 download->GetTargetFilePath().value());
261 dl_item_value->SetBoolean("is_paused", download->is_paused()); 261 dl_item_value->SetBoolean("is_paused", download->is_paused());
262 dl_item_value->SetBoolean("open_when_complete", 262 dl_item_value->SetBoolean("open_when_complete",
263 download->open_when_complete()); 263 download->open_when_complete());
264 dl_item_value->SetBoolean("is_extension_install", 264 dl_item_value->SetBoolean("is_extension_install",
265 download->is_extension_install()); 265 download->is_extension_install());
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 971
972 void AutomationProvider::SaveAsAsync(int tab_handle) { 972 void AutomationProvider::SaveAsAsync(int tab_handle) {
973 NavigationController* tab = NULL; 973 NavigationController* tab = NULL;
974 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); 974 TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
975 if (tab_contents) { 975 if (tab_contents) {
976 TabContentsWrapper* wrapper = 976 TabContentsWrapper* wrapper =
977 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents); 977 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
978 wrapper->download_tab_helper()->OnSavePage(); 978 wrapper->download_tab_helper()->OnSavePage();
979 } 979 }
980 } 980 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698