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

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

Issue 11106009: drive: Add the local largest changestamp to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
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 1ba1c81ca03b7f1ae5c1c5588bb13d45e8ddc882..c137b8cc5f5bebc426ef807ed584eb934496fda6 100644
--- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/drive_cache.h"
#include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
+#include "chrome/browser/chromeos/drive/drive_resource_metadata.h"
#include "chrome/browser/chromeos/drive/drive_service_interface.h"
#include "chrome/browser/chromeos/drive/drive_system_service.h"
#include "chrome/browser/google_apis/auth_service.h"
@@ -237,9 +238,8 @@ void DriveInternalsWebUIHandler::OnGetAccountMetadata(
about_resource->quota_bytes_total());
account_metadata.SetDouble("account-quota-used",
about_resource->quota_bytes_used());
- account_metadata.SetString(
- "account-largest-changestamp",
- base::Int64ToString(about_resource->largest_change_id()));
+ account_metadata.SetDouble("account-largest-changestamp-remote",
Haruki Sato 2012/10/15 07:10:29 I personally like string here as they are consider
satorux1 2012/10/16 05:02:56 These are not IDs. These are monotonically increas
+ about_resource->largest_change_id());
// TODO(haruki): Fill installed Drive apps for Drive API.
// http://crbug.com/154241
@@ -251,9 +251,8 @@ void DriveInternalsWebUIHandler::OnGetAccountMetadata(
account_metadata.SetDouble("account-quota-total",
feed->quota_bytes_total());
account_metadata.SetDouble("account-quota-used", feed->quota_bytes_used());
- account_metadata.SetString(
- "account-largest-changestamp",
- base::Int64ToString(feed->largest_changestamp()));
+ account_metadata.SetDouble("account-largest-changestamp-remote",
+ feed->largest_changestamp());
base::ListValue* installed_apps = new base::ListValue();
for (size_t i = 0; i < feed->installed_apps().size(); ++i) {
@@ -269,6 +268,13 @@ void DriveInternalsWebUIHandler::OnGetAccountMetadata(
account_metadata.Set("installed-apps", installed_apps);
}
+ // Add the local largest chargestamp.
+ const drive::DriveResourceMetadata* resource_metadata =
+ GetSystemService()->file_system()->GetResourceMetadata();
+ const int64 largest_changestamp = resource_metadata->largest_changestamp();
+ account_metadata.SetDouble("account-largest-changestamp-local",
+ largest_changestamp);
+
web_ui()->CallJavascriptFunction("updateAccountMetadata", account_metadata);
}

Powered by Google App Engine
This is Rietveld 408576698