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

Side by Side Diff: components/ntp_snippets/content_suggestion.h

Issue 2507793002: [NTP] Propagate OfflineId from C++ for Downloads. (Closed)
Patch Set: rebase and treib@ comments. Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "components/ntp_snippets/category.h" 15 #include "components/ntp_snippets/category.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 namespace ntp_snippets { 18 namespace ntp_snippets {
19 19
20 // DownloadSuggestionExtra contains additional data which is only available for 20 // DownloadSuggestionExtra contains additional data which is only available for
21 // download suggestions. 21 // download suggestions.
22 struct DownloadSuggestionExtra { 22 struct DownloadSuggestionExtra {
23 // The file path of the downloaded file once download completes. 23 // The file path of the downloaded file once download completes.
24 base::FilePath target_file_path; 24 base::FilePath target_file_path;
25 // The effective MIME type of downloaded content. 25 // The effective MIME type of downloaded content.
26 std::string mime_type; 26 std::string mime_type;
27 // Underlying offline page identifier.
28 std::string offline_page_id;
Bernhard Bauer 2016/11/16 17:04:02 Same here -- why is this a string and not an int64
vitaliii 2016/11/16 17:28:10 Done.
27 // Whether or not the download suggestion is a downloaded asset. 29 // Whether or not the download suggestion is a downloaded asset.
30 // When this is true, |offline_page_id| is ignored, otherwise
31 // |target_file_path| and |mime_type| are ignored.
28 bool is_download_asset = false; 32 bool is_download_asset = false;
29 }; 33 };
30 34
31 // Contains additional data which is only available for recent tab suggestions. 35 // Contains additional data which is only available for recent tab suggestions.
32 struct RecentTabSuggestionExtra { 36 struct RecentTabSuggestionExtra {
33 // Corresponding tab identifier. 37 // Corresponding tab identifier.
34 std::string tab_id; 38 std::string tab_id;
35 // Underlying offline page identifier. 39 // Underlying offline page identifier.
36 std::string offline_page_id; 40 std::string offline_page_id;
37 }; 41 };
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra_; 148 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion); 150 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion);
147 }; 151 };
148 152
149 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id); 153 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id);
150 154
151 } // namespace ntp_snippets 155 } // namespace ntp_snippets
152 156
153 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ 157 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698