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_internals_ui.h" | 5 #include "chrome/browser/ui/webui/offline_internals_ui.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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 void OfflineInternalsUIMessageHandler::HandleGetStoredPages( | 259 void OfflineInternalsUIMessageHandler::HandleGetStoredPages( |
260 const base::ListValue* args) { | 260 const base::ListValue* args) { |
261 AllowJavascript(); | 261 AllowJavascript(); |
262 std::string callback_id; | 262 std::string callback_id; |
263 CHECK(args->GetString(0, &callback_id)); | 263 CHECK(args->GetString(0, &callback_id)); |
264 | 264 |
265 if (offline_page_model_) { | 265 if (offline_page_model_) { |
266 offline_page_model_->GetAllPages( | 266 offline_page_model_->GetAllPagesWithExpired( |
267 base::Bind(&OfflineInternalsUIMessageHandler::HandleStoredPagesCallback, | 267 base::Bind(&OfflineInternalsUIMessageHandler::HandleStoredPagesCallback, |
268 weak_ptr_factory_.GetWeakPtr(), callback_id)); | 268 weak_ptr_factory_.GetWeakPtr(), callback_id)); |
269 } else { | 269 } else { |
270 base::ListValue results; | 270 base::ListValue results; |
271 ResolveJavascriptCallback(base::StringValue(callback_id), results); | 271 ResolveJavascriptCallback(base::StringValue(callback_id), results); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 void OfflineInternalsUIMessageHandler::HandleSetRecordPageModel( | 275 void OfflineInternalsUIMessageHandler::HandleSetRecordPageModel( |
276 const base::ListValue* args) { | 276 const base::ListValue* args) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 html_source->AddResourcePath("offline_internals_browser_proxy.js", | 416 html_source->AddResourcePath("offline_internals_browser_proxy.js", |
417 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS); | 417 IDR_OFFLINE_INTERNALS_BROWSER_PROXY_JS); |
418 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML); | 418 html_source->SetDefaultResource(IDR_OFFLINE_INTERNALS_HTML); |
419 | 419 |
420 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); | 420 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source); |
421 | 421 |
422 web_ui->AddMessageHandler(new OfflineInternalsUIMessageHandler()); | 422 web_ui->AddMessageHandler(new OfflineInternalsUIMessageHandler()); |
423 } | 423 } |
424 | 424 |
425 OfflineInternalsUI::~OfflineInternalsUI() {} | 425 OfflineInternalsUI::~OfflineInternalsUI() {} |
OLD | NEW |