Skip to content

Commit

Permalink
CrOS Shelf: Fold the 'dense shelf' flag into 'hotseat'
Browse files Browse the repository at this point in the history
The original plan was to potentially enable the denser shelf early, as
a first step, but it looks like it will now be enabled with the rest
of the shelf redesign.

There is now no need for the extra complexity of a separate flag for
the "densification".

Bug: 973483, 973482
Change-Id: I65d491818cecba93962823eb93c7c62f749f779f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1799385
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Matthew Mourgos <mmourgos@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695849}
  • Loading branch information
Manu Cornet authored and Commit Bot committed Sep 12, 2019
1 parent 68de71d commit 2bacefe
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 45 deletions.
3 changes: 1 addition & 2 deletions ash/public/cpp/app_list/app_list_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ AppListConfig::AppListConfig(ash::AppListConfigType type)
grid_tile_spacing_in_folder_(8),
// TODO(manucornet): Share the value with ShelfConstants and use
// 48 when the new shelf UI is turned off.
shelf_height_(chromeos::switches::ShouldShowShelfDenseClamshell() ? 48
: 56),
shelf_height_(chromeos::switches::ShouldShowShelfHotseat() ? 48 : 56),
background_radius_(shelf_height_ / 2),
blur_radius_(30),
contents_background_color_(SkColorSetRGB(0xF2, 0xF2, 0xF2)),
Expand Down
8 changes: 4 additions & 4 deletions ash/shelf/login_shelf_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ std::unique_ptr<SkPath> GetButtonHighlightPath(views::View* view) {
auto path = std::make_unique<SkPath>();

gfx::Rect rect(view->GetLocalBounds());
rect.Inset(chromeos::switches::ShouldShowShelfDenseClamshell()
rect.Inset(chromeos::switches::ShouldShowShelfHotseat()
? kButtonBackgroundMarginDense
: kButtonBackgroundMargin);

int border_radius = chromeos::switches::ShouldShowShelfDenseClamshell()
int border_radius = chromeos::switches::ShouldShowShelfHotseat()
? kButtonRoundedBorderRadiusDpDense
: kButtonRoundedBorderRadiusDp;
path->addRoundRect(gfx::RectToSkRect(rect), border_radius, border_radius);
Expand Down Expand Up @@ -183,10 +183,10 @@ class LoginShelfButton : public views::LabelButton {

// views::LabelButton:
gfx::Insets GetInsets() const override {
int top_margin = chromeos::switches::ShouldShowShelfDenseClamshell()
int top_margin = chromeos::switches::ShouldShowShelfHotseat()
? kButtonMarginTopDpDense
: kButtonMarginTopDp;
int bottom_margin = chromeos::switches::ShouldShowShelfDenseClamshell()
int bottom_margin = chromeos::switches::ShouldShowShelfHotseat()
? kButtonMarginBottomDpDense
: kButtonMarginBottomDp;
return gfx::Insets(top_margin, kButtonMarginLeftDp, bottom_margin,
Expand Down
2 changes: 1 addition & 1 deletion ash/shelf/shelf_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace ash {

ShelfConfig::ShelfConfig()
: is_dense_(chromeos::switches::ShouldShowShelfDenseClamshell()),
: is_dense_(chromeos::switches::ShouldShowShelfHotseat()),
shelf_size_(56),
shelf_size_dense_(48),
shelf_button_icon_size_(44),
Expand Down
2 changes: 1 addition & 1 deletion ash/system/status_area_widget_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void StatusAreaWidgetDelegate::SetBorderOnChild(views::View* child,

// TODO: ensure that this is set in tablet mode, only when dense shelf
// threshold is met. (just make this variable a member of ShelfConfig)
if (is_child_on_edge && chromeos::switches::ShouldShowShelfDenseClamshell())
if (is_child_on_edge && chromeos::switches::ShouldShowShelfHotseat())
right_edge = kPaddingBetweenWidgetAndRightScreenEdge;

// Swap edges if alignment is not horizontal (bottom-to-top).
Expand Down
10 changes: 5 additions & 5 deletions ash/system/tray/tray_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ constexpr int kUnifiedDetailedViewTitleRowHeight = 64;
class TrayConstants {
public:
static int hit_region_padding() {
return UseNewDenseShelfUi() ? kHitRegionPaddingDense : kHitRegionPadding;
return UseNewHotseatShelfUi() ? kHitRegionPaddingDense : kHitRegionPadding;
}

private:
static bool UseNewDenseShelfUi() {
static bool use_new_dense_shelf_ui =
chromeos::switches::ShouldShowShelfDenseClamshell();
return use_new_dense_shelf_ui;
static bool UseNewHotseatShelfUi() {
static bool use_new_hotseat_shelf_ui =
chromeos::switches::ShouldShowShelfHotseat();
return use_new_hotseat_shelf_ui;
}

DISALLOW_IMPLICIT_CONSTRUCTORS(TrayConstants);
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1692,9 +1692,6 @@ const FeatureEntry kFeatureEntries[] = {
{"newblue", flag_descriptions::kNewblueName,
flag_descriptions::kNewblueDescription, kOsCrOS,
FEATURE_VALUE_TYPE(device::kNewblueDaemon)},
{"shelf-dense-clamshell", flag_descriptions::kShelfDenseClamshellName,
flag_descriptions::kShelfDenseClamshellDescription, kOsCrOS,
SINGLE_VALUE_TYPE(chromeos::switches::kShelfDenseClamshell)},
{"shelf-hotseat", flag_descriptions::kShelfHotseatName,
flag_descriptions::kShelfHotseatDescription, kOsCrOS,
SINGLE_VALUE_TYPE(chromeos::switches::kShelfHotseat)},
Expand Down
7 changes: 1 addition & 6 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2932,14 +2932,9 @@
"owners": [ "//chrome/browser/sharing/OWNERS" ],
"expiry_milestone": 80
},
{
"name": "shelf-dense-clamshell",
"owners": [ "manucornet", "mmourgos" ],
"expiry_milestone": 82
},
{
"name": "shelf-hotseat",
"owners": [ "manucornet", "newcomer" ],
"owners": [ "manucornet", "mmourgos", "newcomer" ],
"expiry_milestone": 82
},
{
Expand Down
8 changes: 2 additions & 6 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1809,16 +1809,12 @@ const char kSharingUseDeviceInfoDescription[] =
"Enables Sharing infrastructure to register devices in DeviceInfo and "
"remove sync requirement.";

const char kShelfDenseClamshellName[] =
"Show a smaller, denser shelf in laptop mode.";
const char kShelfDenseClamshellDescription[] =
"Reduces the size of the shelf and its apps when in laptop mode.";

const char kShelfHotseatName[] = "Enable a modular design for the shelf.";
const char kShelfHotseatDescription[] =
"Shows a modular design for the shelf where the apps are shown separately "
"in a 'hotseat' interface when in tablet mode, and where various pieces "
"are separate and behave independently.";
"are separate and behave independently. Also reduces the size of the"
"shelf and its app when in laptop mode.";

const char kShelfHoverPreviewsName[] =
"Show previews of running apps when hovering over the shelf.";
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,6 @@ extern const char kSharingDeviceRegistrationDescription[];
extern const char kSharingUseDeviceInfoName[];
extern const char kSharingUseDeviceInfoDescription[];

extern const char kShelfDenseClamshellName[];
extern const char kShelfDenseClamshellDescription[];

extern const char kShelfHotseatName[];
extern const char kShelfHotseatDescription[];

Expand Down
11 changes: 2 additions & 9 deletions chromeos/constants/chromeos_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,8 @@ const char kRlzPingDelay[] = "rlz-ping-delay";
// TODO(941489): Remove when the bug is fixed.
const char kSamlPasswordChangeUrl[] = "saml-password-change-url";

// Smaller, denser shelf in clamshell mode.
const char kShelfDenseClamshell[] = "shelf-dense-clamshell";

// New modular design for the shelf with apps separated into a hotseat UI.
// New modular design for the shelf with apps separated into a hotseat UI and
// smaller shelf in clamshell mode.
const char kShelfHotseat[] = "shelf-hotseat";

// App window previews when hovering over the shelf.
Expand Down Expand Up @@ -547,11 +545,6 @@ bool IsSigninFrameClientCertUserSelectionEnabled() {
kDisableSigninFrameClientCertUserSelection);
}

bool ShouldShowShelfDenseClamshell() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
kShelfDenseClamshell);
}

bool ShouldShowShelfHotseat() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(kShelfHotseat);
}
Expand Down
7 changes: 2 additions & 5 deletions chromeos/constants/chromeos_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ extern const char kRedirectLibassistantLogging[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kRegulatoryLabelDir[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kRlzPingDelay[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kSamlPasswordChangeUrl[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kShelfDenseClamshell[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kShelfHoverPreviews[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kShelfHotseat[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kShelfScrollable[];
Expand Down Expand Up @@ -223,10 +222,8 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsSigninFrameClientCertsEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
bool IsSigninFrameClientCertUserSelectionEnabled();

// Returns true if we should show a smaller, denser shelf in clamshell mode.
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool ShouldShowShelfDenseClamshell();

// Returns true if we should show the modular shelf with the hotseat UI.
// Returns true if we should show the modular shelf with the hotseat UI and
// a smaller shelf in clamshell mode.
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool ShouldShowShelfHotseat();

// Returns true if we should show window previews when hovering over an app
Expand Down

0 comments on commit 2bacefe

Please sign in to comment.