OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/drive_internals_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 weak_ptr_factory_.GetWeakPtr())); | 513 weak_ptr_factory_.GetWeakPtr())); |
514 } | 514 } |
515 | 515 |
516 void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate( | 516 void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate( |
517 const drive::DriveFileSystemMetadata& metadata) { | 517 const drive::DriveFileSystemMetadata& metadata) { |
518 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 518 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
519 | 519 |
520 base::DictionaryValue delta_update_status; | 520 base::DictionaryValue delta_update_status; |
521 delta_update_status.SetBoolean("push-notification-enabled", | 521 delta_update_status.SetBoolean("push-notification-enabled", |
522 metadata.push_notification_enabled); | 522 metadata.push_notification_enabled); |
523 delta_update_status.SetInteger("polling-interval-sec", | |
524 metadata.polling_interval_sec); | |
525 delta_update_status.SetString( | 523 delta_update_status.SetString( |
526 "last-update-check-time", | 524 "last-update-check-time", |
527 google_apis::util::FormatTimeAsStringLocaltime( | 525 google_apis::util::FormatTimeAsStringLocaltime( |
528 metadata.last_update_check_time)); | 526 metadata.last_update_check_time)); |
529 delta_update_status.SetString( | 527 delta_update_status.SetString( |
530 "last-update-check-error", | 528 "last-update-check-error", |
531 drive::DriveFileErrorToString(metadata.last_update_check_error)); | 529 drive::DriveFileErrorToString(metadata.last_update_check_error)); |
532 | 530 |
533 web_ui()->CallJavascriptFunction("updateDeltaUpdateStatus", | 531 web_ui()->CallJavascriptFunction("updateDeltaUpdateStatus", |
534 delta_update_status); | 532 delta_update_status); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 756 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
759 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 757 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
760 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 758 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
761 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 759 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
762 | 760 |
763 Profile* profile = Profile::FromWebUI(web_ui); | 761 Profile* profile = Profile::FromWebUI(web_ui); |
764 content::WebUIDataSource::Add(profile, source); | 762 content::WebUIDataSource::Add(profile, source); |
765 } | 763 } |
766 | 764 |
767 } // namespace chromeos | 765 } // namespace chromeos |
OLD | NEW |