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

Unified Diff: chrome/browser/ui/webui/chromeos/drive_internals_ui.cc

Issue 11343004: drive: Add "Delta Update Status" section to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/resources/chromeos/drive_internals.js ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
index d5d2c60803ecd4a960731a65ff99796733e3eee0..fb8fa74debb91c97b9da89d131035f99184b72a0 100644
--- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
@@ -192,6 +192,7 @@ class DriveInternalsWebUIHandler : public content::WebUIMessageHandler {
google_apis::DriveServiceInterface* drive_service);
void UpdateAccountMetadataSection(
google_apis::DriveServiceInterface* drive_service);
+ void UpdateDeltaUpdateStatusSection();
void UpdateInFlightOperationsSection(
google_apis::DriveServiceInterface* drive_service);
void UpdateGCacheContentsSection();
@@ -327,6 +328,7 @@ void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) {
UpdateDriveRelatedPreferencesSection();
UpdateAuthStatusSection(drive_service);
UpdateAccountMetadataSection(drive_service);
+ UpdateDeltaUpdateStatusSection();
UpdateInFlightOperationsSection(drive_service);
UpdateGCacheContentsSection();
UpdateFileSystemContentsSection(drive_service);
@@ -403,6 +405,28 @@ void DriveInternalsWebUIHandler::UpdateAccountMetadataSection(
weak_ptr_factory_.GetWeakPtr()));
}
+void DriveInternalsWebUIHandler::UpdateDeltaUpdateStatusSection() {
+ const drive::DriveFileSystemMetadata metadata =
+ GetSystemService()->file_system()->GetMetadata();
+
+ base::DictionaryValue delta_update_status;
+ delta_update_status.SetBoolean("push-notification-enabled",
+ metadata.push_notification_enabled);
+ delta_update_status.SetInteger("polling-interval-sec",
+ metadata.polling_interval_sec);
+ delta_update_status.SetString(
+ "last-update-check-time",
+ google_apis::util::FormatTimeAsStringLocaltime(
+ metadata.last_update_check_time));
+ delta_update_status.SetString(
+ "last-update-check-error",
+ drive::DriveFileErrorToString(metadata.last_update_check_error));
+
+ web_ui()->CallJavascriptFunction("updateDeltaUpdateStatus",
+ delta_update_status);
+
+}
+
void DriveInternalsWebUIHandler::UpdateInFlightOperationsSection(
google_apis::DriveServiceInterface* drive_service) {
google_apis::OperationProgressStatusList
« no previous file with comments | « chrome/browser/resources/chromeos/drive_internals.js ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698