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

Side by Side Diff: content/browser/download/save_package.h

Issue 10387090: Pass the referrer policy with the referrer for the save package code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 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
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 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/hash_tables.h" 16 #include "base/hash_tables.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/time.h" 19 #include "base/time.h"
20 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
21 #include "content/public/browser/download_item.h" 21 #include "content/public/browser/download_item.h"
22 #include "content/public/browser/download_manager_delegate.h" 22 #include "content/public/browser/download_manager_delegate.h"
23 #include "content/public/browser/save_page_type.h" 23 #include "content/public/browser/save_page_type.h"
24 #include "content/public/browser/web_contents_observer.h" 24 #include "content/public/browser/web_contents_observer.h"
25 #include "content/public/common/referrer.h"
25 #include "googleurl/src/gurl.h" 26 #include "googleurl/src/gurl.h"
26 27
27 class GURL; 28 class GURL;
28 class SaveFileManager; 29 class SaveFileManager;
29 class SaveItem; 30 class SaveItem;
30 class SavePackage; 31 class SavePackage;
31 struct SaveFileCreateInfo; 32 struct SaveFileCreateInfo;
32 33
33 namespace content { 34 namespace content {
34 class DownloadManager; 35 class DownloadManager;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 const std::string& mime_type, 192 const std::string& mime_type,
192 const std::string& accept_langs); 193 const std::string& accept_langs);
193 void ContinueGetSaveInfo(const FilePath& suggested_path, 194 void ContinueGetSaveInfo(const FilePath& suggested_path,
194 bool can_save_as_complete); 195 bool can_save_as_complete);
195 void OnPathPicked( 196 void OnPathPicked(
196 const FilePath& final_name, 197 const FilePath& final_name,
197 content::SavePageType type, 198 content::SavePageType type,
198 const content::SavePackageDownloadCreatedCallback& cb); 199 const content::SavePackageDownloadCreatedCallback& cb);
199 void OnReceivedSavableResourceLinksForCurrentPage( 200 void OnReceivedSavableResourceLinksForCurrentPage(
200 const std::vector<GURL>& resources_list, 201 const std::vector<GURL>& resources_list,
201 const std::vector<GURL>& referrers_list, 202 const std::vector<content::Referrer>& referrers_list,
202 const std::vector<GURL>& frames_list); 203 const std::vector<GURL>& frames_list);
203 204
204 void OnReceivedSerializedHtmlData(const GURL& frame_url, 205 void OnReceivedSerializedHtmlData(const GURL& frame_url,
205 const std::string& data, 206 const std::string& data,
206 int32 status); 207 int32 status);
207 208
208 typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap; 209 typedef base::hash_map<std::string, SaveItem*> SaveUrlItemMap;
209 // in_progress_items_ is map of all saving job in in-progress state. 210 // in_progress_items_ is map of all saving job in in-progress state.
210 SaveUrlItemMap in_progress_items_; 211 SaveUrlItemMap in_progress_items_;
211 // saved_failed_items_ is map of all saving job which are failed. 212 // saved_failed_items_ is map of all saving job which are failed.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 bool wrote_to_failed_file_; 321 bool wrote_to_failed_file_;
321 322
322 friend class SavePackageTest; 323 friend class SavePackageTest;
323 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); 324 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames);
324 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); 325 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename);
325 326
326 DISALLOW_COPY_AND_ASSIGN(SavePackage); 327 DISALLOW_COPY_AND_ASSIGN(SavePackage);
327 }; 328 };
328 329
329 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ 330 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698