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

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

Issue 2184083002: Storage manager: Hide "Offline files" when Google Drive volume is not mounted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 d08d62329d4a976df7e0131e6dc8a931b99a41c0..ccee5311adcaebe3729875404ce89f8337ce24db 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