| OLD | NEW |
| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 base::Value(net::NetworkChangeNotifier::IsOffline() ? "Offline" | 229 base::Value(net::NetworkChangeNotifier::IsOffline() ? "Offline" |
| 230 : "Online")); | 230 : "Online")); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void OfflineInternalsUIMessageHandler::HandleScheduleNwake( | 233 void OfflineInternalsUIMessageHandler::HandleScheduleNwake( |
| 234 const base::ListValue* args) { | 234 const base::ListValue* args) { |
| 235 AllowJavascript(); | 235 AllowJavascript(); |
| 236 const base::Value* callback_id; | 236 const base::Value* callback_id; |
| 237 CHECK(args->Get(0, &callback_id)); | 237 CHECK(args->Get(0, &callback_id)); |
| 238 | 238 |
| 239 offline_pages::PrefetchBackgroundTask::Schedule(); | 239 offline_pages::PrefetchBackgroundTask::Schedule(0); |
| 240 | 240 |
| 241 ResolveJavascriptCallback(*callback_id, base::Value("Scheduled.")); | 241 ResolveJavascriptCallback(*callback_id, base::Value("Scheduled.")); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void OfflineInternalsUIMessageHandler::HandleCancelNwake( | 244 void OfflineInternalsUIMessageHandler::HandleCancelNwake( |
| 245 const base::ListValue* args) { | 245 const base::ListValue* args) { |
| 246 AllowJavascript(); | 246 AllowJavascript(); |
| 247 const base::Value* callback_id; | 247 const base::Value* callback_id; |
| 248 CHECK(args->Get(0, &callback_id)); | 248 CHECK(args->Get(0, &callback_id)); |
| 249 | 249 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 377 |
| 378 // Get the offline page model associated with this web ui. | 378 // Get the offline page model associated with this web ui. |
| 379 Profile* profile = Profile::FromWebUI(web_ui()); | 379 Profile* profile = Profile::FromWebUI(web_ui()); |
| 380 offline_page_model_ = | 380 offline_page_model_ = |
| 381 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile); | 381 offline_pages::OfflinePageModelFactory::GetForBrowserContext(profile); |
| 382 request_coordinator_ = | 382 request_coordinator_ = |
| 383 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile); | 383 offline_pages::RequestCoordinatorFactory::GetForBrowserContext(profile); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace offline_internals | 386 } // namespace offline_internals |
| OLD | NEW |