Commit 183c06ca authored by Tim Zheng's avatar Tim Zheng Committed by Commit Bot

No menu item for display density for the terminal.

The default Crostini terminal app is crosh in a Chrome window and the
display density toggle doesn't apply.

BUG=chromium:839242;chromium:900032
TEST=Manually tested on an eve device

Change-Id: I5d7007009803b63590864e107ece80082f9cfb9b
Reviewed-on: https://chromium-review.googlesource.com/c/1308416Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Tim Zheng <timzheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604278}
parent 1d503a5b
...@@ -91,6 +91,9 @@ class CrostiniRegistryService : public KeyedService { ...@@ -91,6 +91,9 @@ class CrostiniRegistryService : public KeyedService {
// Whether this app should scale up when displayed. // Whether this app should scale up when displayed.
bool IsScaled() const; bool IsScaled() const;
// Whether this app is the default terminal app.
bool is_terminal_app() const { return is_terminal_app_; }
private: private:
std::string LocalizedString(base::StringPiece key) const; std::string LocalizedString(base::StringPiece key) const;
......
...@@ -61,13 +61,17 @@ void CrostiniShelfContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) { ...@@ -61,13 +61,17 @@ void CrostiniShelfContextMenu::BuildMenu(ui::SimpleMenuModel* menu_model) {
// Some apps have high-density display support and do not require scaling // Some apps have high-density display support and do not require scaling
// to match the system display density, but others are density-unaware and // to match the system display density, but others are density-unaware and
// look better when scaled to match the display density. // look better when scaled to match the display density.
if (registration.has_value() && registration->IsScaled()) { // The default terminal app is crosh in a Chrome window and it doesn't run in
// the Crostini container so it doesn't support display density the same way.
if (registration.has_value() && !registration->is_terminal_app()) {
if (registration->IsScaled()) {
menu_model->AddCheckItemWithStringId(ash::CROSTINI_USE_HIGH_DENSITY, menu_model->AddCheckItemWithStringId(ash::CROSTINI_USE_HIGH_DENSITY,
IDS_CROSTINI_USE_HIGH_DENSITY); IDS_CROSTINI_USE_HIGH_DENSITY);
} else { } else {
menu_model->AddCheckItemWithStringId(ash::CROSTINI_USE_LOW_DENSITY, menu_model->AddCheckItemWithStringId(ash::CROSTINI_USE_LOW_DENSITY,
IDS_CROSTINI_USE_LOW_DENSITY); IDS_CROSTINI_USE_LOW_DENSITY);
} }
}
if (!features::IsTouchableAppContextMenuEnabled()) if (!features::IsTouchableAppContextMenuEnabled())
menu_model->AddSeparator(ui::NORMAL_SEPARATOR); menu_model->AddSeparator(ui::NORMAL_SEPARATOR);
......
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