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

Side by Side Diff: chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc

Issue 2484223005: Store original request URL in offline page metadata table (Closed)
Patch Set: Address feedback 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 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h " 5 #include "chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h "
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 results.Append(offline_page); 138 results.Append(offline_page);
139 offline_page->SetString("onlineUrl", page.url.spec()); 139 offline_page->SetString("onlineUrl", page.url.spec());
140 offline_page->SetString("namespace", page.client_id.name_space); 140 offline_page->SetString("namespace", page.client_id.name_space);
141 offline_page->SetDouble("size", page.file_size); 141 offline_page->SetDouble("size", page.file_size);
142 offline_page->SetString("id", std::to_string(page.offline_id)); 142 offline_page->SetString("id", std::to_string(page.offline_id));
143 offline_page->SetString("filePath", page.file_path.MaybeAsASCII()); 143 offline_page->SetString("filePath", page.file_path.MaybeAsASCII());
144 offline_page->SetDouble("creationTime", page.creation_time.ToJsTime()); 144 offline_page->SetDouble("creationTime", page.creation_time.ToJsTime());
145 offline_page->SetDouble("lastAccessTime", page.last_access_time.ToJsTime()); 145 offline_page->SetDouble("lastAccessTime", page.last_access_time.ToJsTime());
146 offline_page->SetInteger("accessCount", page.access_count); 146 offline_page->SetInteger("accessCount", page.access_count);
147 offline_page->SetString("isExpired", page.IsExpired() ? "Yes" : "No"); 147 offline_page->SetString("isExpired", page.IsExpired() ? "Yes" : "No");
148 offline_page->SetString("originalUrl", page.original_url.spec());
148 } 149 }
149 ResolveJavascriptCallback(base::StringValue(callback_id), results); 150 ResolveJavascriptCallback(base::StringValue(callback_id), results);
150 } 151 }
151 152
152 void OfflineInternalsUIMessageHandler::HandleRequestQueueCallback( 153 void OfflineInternalsUIMessageHandler::HandleRequestQueueCallback(
153 std::string callback_id, 154 std::string callback_id,
154 offline_pages::RequestQueue::GetRequestsResult result, 155 offline_pages::RequestQueue::GetRequestsResult result,
155 std::vector<std::unique_ptr<offline_pages::SavePageRequest>> requests) { 156 std::vector<std::unique_ptr<offline_pages::SavePageRequest>> requests) {
156 base::ListValue save_page_requests; 157 base::ListValue save_page_requests;
157 if (result == offline_pages::RequestQueue::GetRequestsResult::SUCCESS) { 158 if (result == offline_pages::RequestQueue::GetRequestsResult::SUCCESS) {
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 340
340 // Get the offline page model associated with this web ui. 341 // Get the offline page model associated with this web ui.
341 Profile* profile = Profile::FromWebUI(web_ui()); 342 Profile* profile = Profile::FromWebUI(web_ui());
342 offline_page_model_ = 343 offline_page_model_ =
343 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile); 344 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile);
344 request_coordinator_ = 345 request_coordinator_ =
345 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile); 346 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile);
346 } 347 }
347 348
348 } // namespace offline_internals 349 } // namespace offline_internals
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/recent_tab_helper.cc ('k') | components/offline_pages/offline_page_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698