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

Unified Diff: chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc

Issue 2202483002: Storage manager: Hide "Offline files" when Google Drive volume is not mounted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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
« no previous file with comments | « chrome/browser/resources/options/chromeos/storage_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc b/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
index c49798d764f261c46692fb2e4b9c0184739108bf..a64edc1108631478c5677568fb40fdee1ef77499 100644
--- a/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/storage_manager_handler.cc
@@ -269,10 +269,16 @@ void StorageManagerHandler::OnGetDownloadsSize(int64_t size) {
void StorageManagerHandler::UpdateDriveCacheSize() {
if (updating_drive_cache_size_)
return;
- updating_drive_cache_size_ = true;
drive::FileSystemInterface* const file_system =
drive::util::GetFileSystemByProfile(Profile::FromWebUI(web_ui()));
+ if (!file_system)
+ return;
+
+ // Shows the item "Offline cache" and start calculating size.
+ web_ui()->CallJavascriptFunctionUnsafe(
+ "options.StorageManager.showDriveCacheItem");
+ updating_drive_cache_size_ = true;
file_system->CalculateCacheSize(
base::Bind(&StorageManagerHandler::OnGetDriveCacheSize,
weak_ptr_factory_.GetWeakPtr()));
« no previous file with comments | « chrome/browser/resources/options/chromeos/storage_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698