forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ash: Add QS tile for shelf party mode
Bug: 1262374 Test: ash_unittests ShelfPartyQsTileTest.* Test: ash_unittests ShelfControllerShelfPartyTest.* Change-Id: Ifc8f7948f85feb8f6664ad5b5648227331d40837 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3290495 Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Avery Musbach <amusbach@chromium.org> Cr-Commit-Position: refs/heads/main@{#943338}
- Loading branch information
Avery Musbach
authored and
Chromium LUCI CQ
committed
Nov 19, 2021
1 parent
e6c392d
commit 2041a09
Showing
30 changed files
with
367 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_DISABLED_STATE_TOOLTIP.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d54188f8bff1ce8b7373f98a92b92bfd0fee092e |
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_ENABLED_STATE_TOOLTIP.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a0a1d8bbf3bda871177fda7df20f198e883e3634 |
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_LABEL.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
07e87468238a9ee999d954266cc29c6cb81c9e6a |
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_OFF_SUBLABEL.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9b14f0cdbecc32ed7a4de8de4da1424ca136513b |
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_ON_SUBLABEL.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
07e87468238a9ee999d954266cc29c6cb81c9e6a |
1 change: 1 addition & 0 deletions
1
ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_SHELF_PARTY_TOGGLE_TOOLTIP.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a0a1d8bbf3bda871177fda7df20f198e883e3634 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
CANVAS_DIMENSIONS, 24, | ||
MOVE_TO, 13.16f, 8.8f, | ||
R_CUBIC_TO, -1.69f, 4.61f, -7.68f, 7.64f, -9.53f, 6.96f, | ||
CUBIC_TO, 1.79f, 15.09f, -0.82f, 8.9f, 0.87f, 4.29f, | ||
R_ARC_TO, 6.55f, 6.55f, 0, 1, 1, 12.29f, 4.51f, | ||
CLOSE, | ||
NEW_PATH, | ||
MOVE_TO, 4.2f, 14.23f, | ||
LINE_TO, 0, 16.17f, | ||
R_LINE_TO, 6.15f, 2.25f, | ||
CLOSE, | ||
NEW_PATH, | ||
MOVE_TO, 20.5f, 15.39f, | ||
R_CUBIC_TO, -0.99f, -0.03f, -2.02f, 0.18f, -3.01f, 0.54f, | ||
R_CUBIC_TO, -1.99f, 0.72f, -3.99f, 1.99f, -5.94f, 3.2f, | ||
R_CUBIC_TO, -1.95f, 1.21f, -3.84f, 2.35f, -5.41f, 2.84f, | ||
R_CUBIC_TO, -0.79f, 0.25f, -1.48f, 0.34f, -2.06f, 0.25f, | ||
R_CUBIC_TO, -0.58f, -0.09f, -1.07f, -0.32f, -1.56f, -0.85f, | ||
R_CUBIC_TO, -0.05f, -0.05f, -0.12f, -0.22f, -0.04f, -0.63f, | ||
R_CUBIC_TO, 0.07f, -0.41f, 0.28f, -0.96f, 0.54f, -1.48f, | ||
R_CUBIC_TO, 0.52f, -1.04f, 1.19f, -1.97f, 1.19f, -1.97f, | ||
LINE_TO, 2.8f, 16.25f, | ||
R_CUBIC_TO, 0, 0, -0.75f, 1.01f, -1.35f, 2.23f, | ||
R_CUBIC_TO, -0.3f, 0.61f, -0.57f, 1.27f, -0.69f, 1.96f, | ||
R_CUBIC_TO, -0.12f, 0.69f, -0.08f, 1.51f, 0.49f, 2.12f, | ||
R_CUBIC_TO, 0.73f, 0.78f, 1.63f, 1.24f, 2.57f, 1.39f, | ||
R_CUBIC_TO, 0.94f, 0.14f, 1.89f, 0, 2.85f, -0.3f, | ||
R_CUBIC_TO, 1.91f, -0.6f, 3.86f, -1.82f, 5.81f, -3.03f, | ||
R_CUBIC_TO, 1.95f, -1.21f, 3.9f, -2.41f, 5.61f, -3.04f, | ||
R_CUBIC_TO, 1.71f, -0.62f, 3.04f, -0.68f, 4.19f, 0.18f, | ||
R_CUBIC_TO, -0.11f, -0.08f, -0.07f, -0.1f, -0.05f, 0.02f, | ||
R_CUBIC_TO, 0.02f, 0.13f, 0.03f, 0.35f, 0.01f, 0.57f, | ||
R_CUBIC_TO, -0.04f, 0.44f, -0.14f, 0.86f, -0.14f, 0.86f, | ||
R_LINE_TO, 1.7f, 0.43f, | ||
R_CUBIC_TO, 0, 0, 0.14f, -0.53f, 0.19f, -1.16f, | ||
R_ARC_TO, 3.93f, 3.93f, 0, 0, 0, -0.04f, -1.02f, | ||
R_CUBIC_TO, -0.06f, -0.36f, -0.2f, -0.8f, -0.63f, -1.12f, | ||
R_CUBIC_TO, -0.86f, -0.64f, -1.82f, -0.93f, -2.82f, -0.96f, | ||
CLOSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ash/shelf/shelf_party_feature_pod_controller.h" | ||
|
||
#include "ash/public/cpp/shelf_model.h" | ||
#include "ash/resources/vector_icons/vector_icons.h" | ||
#include "ash/session/session_controller_impl.h" | ||
#include "ash/shelf/shelf_controller.h" | ||
#include "ash/shell.h" | ||
#include "ash/strings/grit/ash_strings.h" | ||
#include "ash/system/unified/feature_pod_button.h" | ||
#include "components/session_manager/session_manager_types.h" | ||
#include "ui/base/l10n/l10n_util.h" | ||
|
||
namespace ash { | ||
|
||
ShelfPartyFeaturePodController::ShelfPartyFeaturePodController() = default; | ||
|
||
ShelfPartyFeaturePodController::~ShelfPartyFeaturePodController() { | ||
Shell::Get()->session_controller()->RemoveObserver(this); | ||
Shell::Get()->shelf_controller()->model()->RemoveObserver(this); | ||
} | ||
|
||
FeaturePodButton* ShelfPartyFeaturePodController::CreateButton() { | ||
DCHECK(!button_); | ||
button_ = new FeaturePodButton(this); | ||
button_->DisableLabelButtonFocus(); | ||
button_->SetVectorIcon(kShelfPartyIcon); | ||
button_->SetLabel( | ||
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SHELF_PARTY_LABEL)); | ||
UpdateButton(); | ||
Shell::Get()->session_controller()->AddObserver(this); | ||
Shell::Get()->shelf_controller()->model()->AddObserver(this); | ||
return button_; | ||
} | ||
|
||
void ShelfPartyFeaturePodController::OnIconPressed() { | ||
Shell::Get()->shelf_controller()->model()->ToggleShelfParty(); | ||
} | ||
|
||
SystemTrayItemUmaType ShelfPartyFeaturePodController::GetUmaType() const { | ||
return SystemTrayItemUmaType::UMA_SHELF_PARTY; | ||
} | ||
|
||
void ShelfPartyFeaturePodController::OnSessionStateChanged( | ||
session_manager::SessionState state) { | ||
UpdateButton(); | ||
} | ||
|
||
void ShelfPartyFeaturePodController::ShelfPartyToggled(bool in_shelf_party) { | ||
UpdateButton(); | ||
} | ||
|
||
void ShelfPartyFeaturePodController::UpdateButton() { | ||
DCHECK(button_); | ||
const SessionControllerImpl* session_controller = | ||
Shell::Get()->session_controller(); | ||
button_->SetVisible(session_controller->GetSessionState() == | ||
session_manager::SessionState::ACTIVE && | ||
!session_controller->IsEnterpriseManaged()); | ||
const bool toggled = | ||
Shell::Get()->shelf_controller()->model()->in_shelf_party(); | ||
button_->SetToggled(toggled); | ||
button_->SetSubLabel(l10n_util::GetStringUTF16( | ||
toggled ? IDS_ASH_STATUS_TRAY_SHELF_PARTY_ON_SUBLABEL | ||
: IDS_ASH_STATUS_TRAY_SHELF_PARTY_OFF_SUBLABEL)); | ||
button_->SetIconAndLabelTooltips(l10n_util::GetStringFUTF16( | ||
IDS_ASH_STATUS_TRAY_SHELF_PARTY_TOGGLE_TOOLTIP, | ||
l10n_util::GetStringUTF16( | ||
toggled ? IDS_ASH_STATUS_TRAY_SHELF_PARTY_ENABLED_STATE_TOOLTIP | ||
: IDS_ASH_STATUS_TRAY_SHELF_PARTY_DISABLED_STATE_TOOLTIP))); | ||
} | ||
|
||
} // namespace ash |
Oops, something went wrong.