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

Unified Diff: chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc

Issue 2342603004: [Offline pages] Clean up unnecessary DeleteAll calls in offline internals (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
diff --git a/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc b/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
index ed3f8ced80ace3666f86c0e8e9faf17a862f1ed3..48d6aeb100b5c379cb74fc62691043f16a0e84fc 100644
--- a/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
+++ b/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
@@ -64,18 +64,6 @@ std::string OfflineInternalsUIMessageHandler::GetStringFromSavePageStatus() {
return "Available";
}
-void OfflineInternalsUIMessageHandler::HandleDeleteAllPages(
- const base::ListValue* args) {
- std::string callback_id;
- CHECK(args->GetString(0, &callback_id));
-
- // Pass back success because ClearAll doesn't return a status.
- offline_page_model_->ClearAll(
- base::Bind(&OfflineInternalsUIMessageHandler::HandleDeletedPagesCallback,
- weak_ptr_factory_.GetWeakPtr(), callback_id,
- offline_pages::DeletePageResult::SUCCESS));
-}
-
void OfflineInternalsUIMessageHandler::HandleDeleteSelectedPages(
const base::ListValue* args) {
std::string callback_id;
@@ -99,20 +87,6 @@ void OfflineInternalsUIMessageHandler::HandleDeleteSelectedPages(
weak_ptr_factory_.GetWeakPtr(), callback_id));
}
-void OfflineInternalsUIMessageHandler::HandleDeleteAllRequests(
- const base::ListValue* args) {
- std::string callback_id;
- CHECK(args->GetString(0, &callback_id));
- // First do a get, then in the callback, build a list of IDs, and
- // call RemoveRequests with that list.
- if (request_coordinator_) {
- request_coordinator_->GetAllRequests(
- base::Bind(&OfflineInternalsUIMessageHandler::
- HandleGetAllRequestsForDeleteCallback,
- weak_ptr_factory_.GetWeakPtr(), callback_id));
- }
-}
-
void OfflineInternalsUIMessageHandler::HandleDeleteSelectedRequests(
const base::ListValue* args) {
std::string callback_id;
@@ -140,25 +114,6 @@ void OfflineInternalsUIMessageHandler::HandleDeleteSelectedRequests(
}
}
-void OfflineInternalsUIMessageHandler::HandleGetAllRequestsForDeleteCallback(
- std::string callback_id,
- std::vector<std::unique_ptr<offline_pages::SavePageRequest>> requests) {
- std::vector<int64_t> offline_ids;
- // Build a list of offline_ids from the requests.
- for (const auto& request : requests) {
- offline_ids.push_back(request->request_id());
- }
-
- // Call RequestCoordinator to delete them
- if (request_coordinator_) {
- request_coordinator_->RemoveRequests(
- offline_ids,
- base::Bind(
- &OfflineInternalsUIMessageHandler::HandleDeletedRequestsCallback,
- weak_ptr_factory_.GetWeakPtr(), callback_id));
- }
-}
-
void OfflineInternalsUIMessageHandler::HandleDeletedPagesCallback(
std::string callback_id,
offline_pages::DeletePageResult result) {

Powered by Google App Engine
This is Rietveld 408576698