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

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

Issue 2395903002: API changes to support suspending requests (Closed)
Patch Set: Keep the JS with a boolean instead of forcing a double. Created 4 years, 2 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 "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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 CHECK(args->GetString(1, &url)); 280 CHECK(args->GetString(1, &url));
281 281
282 // To be visible in Downloads UI, these items need a well-formed GUID 282 // To be visible in Downloads UI, these items need a well-formed GUID
283 // and AsyncNamespace in their ClientId. 283 // and AsyncNamespace in their ClientId.
284 std::ostringstream id_stream; 284 std::ostringstream id_stream;
285 id_stream << base::GenerateGUID(); 285 id_stream << base::GenerateGUID();
286 286
287 ResolveJavascriptCallback( 287 ResolveJavascriptCallback(
288 *callback_id, 288 *callback_id,
289 base::FundamentalValue(request_coordinator_->SavePageLater( 289 base::FundamentalValue(request_coordinator_->SavePageLater(
290 GURL(url), offline_pages::ClientId(offline_pages::kAsyncNamespace, 290 GURL(url), offline_pages::ClientId(
291 id_stream.str()), 291 offline_pages::kAsyncNamespace, id_stream.str()),
292 true))); 292 true, offline_pages::RequestCoordinator::RequestAvailability::
293 ENABLED_FOR_OFFLINER) > 0));
293 } else { 294 } else {
294 ResolveJavascriptCallback(*callback_id, base::FundamentalValue(false)); 295 ResolveJavascriptCallback(*callback_id, base::FundamentalValue(false));
295 } 296 }
296 } 297 }
297 298
298 void OfflineInternalsUIMessageHandler::RegisterMessages() { 299 void OfflineInternalsUIMessageHandler::RegisterMessages() {
299 web_ui()->RegisterMessageCallback( 300 web_ui()->RegisterMessageCallback(
300 "deleteSelectedPages", 301 "deleteSelectedPages",
301 base::Bind(&OfflineInternalsUIMessageHandler::HandleDeleteSelectedPages, 302 base::Bind(&OfflineInternalsUIMessageHandler::HandleDeleteSelectedPages,
302 weak_ptr_factory_.GetWeakPtr())); 303 weak_ptr_factory_.GetWeakPtr()));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 341
341 // Get the offline page model associated with this web ui. 342 // Get the offline page model associated with this web ui.
342 Profile* profile = Profile::FromWebUI(web_ui()); 343 Profile* profile = Profile::FromWebUI(web_ui());
343 offline_page_model_ = 344 offline_page_model_ =
344 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile); 345 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile);
345 request_coordinator_ = 346 request_coordinator_ =
346 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile); 347 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile);
347 } 348 }
348 349
349 } // namespace offline_internals 350 } // namespace offline_internals
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_bridge.cc ('k') | components/offline_pages/background/request_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698