Commit 09393b82 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: Hide space info in Files app during demo session

The space info button in the Files app redirects to the “Storage
management” section in Settings, which has already been hidden in Demo
Mode. So it makes sense to hide this button as well.

In Demo Mode (a public session), the cryptohome runs in RAM. As a
result, the Files app only considers available RAM when showing free
disk space. Therefore, customers in stores might think the device only
has 4 GB of disk space.

We should hide the disk space stat until there's a better solution,
e.g. show an explanatory message ("disk space is limited in Demo Mode"
or something).

Bug: 868747
Change-Id: I8b138bbf0b864acaf38a51659cccf7ad3d198c16
Reviewed-on: https://chromium-review.googlesource.com/1198882Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587942}
parent edaa5e8c
......@@ -11,6 +11,7 @@
#include "base/sys_info.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/file_manager/open_with_browser.h"
#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/system/statistics_provider.h"
......@@ -815,6 +816,9 @@ ExtensionFunction::ResponseAction FileManagerPrivateGetStringsFunction::Run() {
file_manager::util::ShouldBeOpenedWithPlugin(
Profile::FromBrowserContext(browser_context()),
FILE_PATH_LITERAL(".swf")));
// TODO(crbug.com/868747): Find a better solution for demo mode.
dict->SetBoolean("HIDE_SPACE_INFO",
chromeos::DemoSession::IsDeviceInDemoMode());
dict->SetString("CHROMEOS_RELEASE_BOARD",
base::SysInfo::GetLsbReleaseBoard());
dict->SetString(
......
......@@ -104,7 +104,7 @@ GearMenu.prototype.setSpaceInfo = function(
spaceInfoPromise, showLoadingCaption) {
this.spaceInfoPromise_ = spaceInfoPromise;
if (!spaceInfoPromise) {
if (!spaceInfoPromise || loadTimeData.getBoolean('HIDE_SPACE_INFO')) {
this.volumeSpaceInfo.hidden = true;
this.volumeSpaceInfoSeparator_.hidden = true;
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment