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

Side by Side Diff: components/offline_pages/downloads/download_ui_item.cc

Issue 2260963003: [Offline pages] Enabling notifications for pages saved later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding tests Created 4 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
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 #include "components/offline_pages/downloads/download_ui_item.h" 5 #include "components/offline_pages/downloads/download_ui_item.h"
6 6
7 #include "components/offline_pages/background/save_page_request.h"
8 #include "components/offline_pages/offline_page_item.h"
9
7 namespace offline_pages { 10 namespace offline_pages {
8 11
9 DownloadUIItem::DownloadUIItem() 12 DownloadUIItem::DownloadUIItem()
10 : total_bytes(0) { 13 : total_bytes(0) {
11 } 14 }
12 15
13 DownloadUIItem::DownloadUIItem(const OfflinePageItem& page) 16 DownloadUIItem::DownloadUIItem(const OfflinePageItem& page)
14 : guid(page.client_id.id), 17 : guid(page.client_id.id),
15 url(page.url), 18 url(page.url),
16 title(page.title), 19 title(page.title),
17 target_path(page.file_path), 20 target_path(page.file_path),
18 start_time(page.creation_time), 21 start_time(page.creation_time),
19 total_bytes(page.file_size) {} 22 total_bytes(page.file_size) {}
20 23
24 DownloadUIItem::DownloadUIItem(const SavePageRequest& request)
25 : guid(request.client_id().id),
26 url(request.url()),
27 start_time(request.creation_time()),
28 total_bytes(-1L) {}
29
21 DownloadUIItem::DownloadUIItem(const DownloadUIItem& other) 30 DownloadUIItem::DownloadUIItem(const DownloadUIItem& other)
22 : guid(other.guid), 31 : guid(other.guid),
23 url(other.url), 32 url(other.url),
Dmitry Titov 2016/08/24 00:29:35 I know it's not part of your patch, but I've notic
fgorski 2016/08/24 18:25:23 Done. Good catch.
24 target_path(other.target_path), 33 target_path(other.target_path),
25 start_time(other.start_time), 34 start_time(other.start_time),
26 total_bytes(other.total_bytes) {} 35 total_bytes(other.total_bytes) {}
27 36
28 DownloadUIItem::~DownloadUIItem() { 37 DownloadUIItem::~DownloadUIItem() {
29 } 38 }
30 39
31 } // namespace offline_pages 40 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698