Commit 5deac0a9 authored by Meilin Wang's avatar Meilin Wang Committed by Commit Bot

[CrOS PhoneHub] Update button on Bluetooth disabled screen.

This CL removes confirmation button on Bluetooth disabled screen to
reflect the spec change.

Screenshot: https://screenshot.googleplex.com/zYMuE9QXvJbEDkr.png

BUG=1145315,1106937

Change-Id: I95f6ea75c9ce0b381467d8515a69faabea42057d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518249Reviewed-by: default avatarTim Song <tengs@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824115}
parent c688ced2
......@@ -31,20 +31,20 @@ BluetoothDisabledView::BluetoothDisabledView() {
SetID(PhoneHubViewID::kBluetoothDisabledView);
SetLayoutManager(std::make_unique<views::FillLayout>());
content_view_ = AddChildView(
auto* content_view = AddChildView(
std::make_unique<PhoneHubInterstitialView>(/*show_progress=*/false));
// TODO(crbug.com/1127996): Replace PNG file with vector icon.
gfx::ImageSkia* image =
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_PHONE_HUB_ERROR_STATE_IMAGE);
content_view_->SetImage(*image);
content_view_->SetTitle(l10n_util::GetStringUTF16(
content_view->SetImage(*image);
content_view->SetTitle(l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_BLUETOOTH_DISABLED_DIALOG_TITLE));
content_view_->SetDescription(l10n_util::GetStringUTF16(
content_view->SetDescription(l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_BLUETOOTH_DISABLED_DIALOG_DESCRIPTION));
// Add "Learn more" and "Ok, got it" buttons.
// Add "Learn more" button.
auto learn_more = std::make_unique<InterstitialViewButton>(
base::BindRepeating(&BluetoothDisabledView::LearnMoreButtonPressed,
base::Unretained(this)),
......@@ -55,16 +55,7 @@ BluetoothDisabledView::BluetoothDisabledView() {
AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
learn_more->SetID(PhoneHubViewID::kBluetoothDisabledLearnMoreButton);
content_view_->AddButton(std::move(learn_more));
auto confirm = std::make_unique<InterstitialViewButton>(
base::BindRepeating(&BluetoothDisabledView::ConfirmButtonPressed,
base::Unretained(this)),
l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_BLUETOOTH_DISABLED_DIALOG_OK_BUTTON),
/*paint_background=*/true);
confirm->SetID(PhoneHubViewID::kBluetoothDisabledConfirmButton);
content_view_->AddButton(std::move(confirm));
content_view->AddButton(std::move(learn_more));
LogInterstitialScreenEvent(InterstitialScreenEvent::kShown);
}
......@@ -81,14 +72,6 @@ void BluetoothDisabledView::LearnMoreButtonPressed() {
GURL(kLearnMoreUrl), /*from_user_interaction=*/true);
}
void BluetoothDisabledView::ConfirmButtonPressed() {
LogInterstitialScreenEvent(InterstitialScreenEvent::kConfirm);
Shell::GetPrimaryRootWindowController()
->GetStatusAreaWidget()
->phone_hub_tray()
->CloseBubble();
}
BEGIN_METADATA(BluetoothDisabledView, views::View)
END_METADATA
......
......@@ -10,8 +10,6 @@
namespace ash {
class PhoneHubInterstitialView;
// An interstitial view representing an error state where the Phone Hub
// feature is not available because Bluetooth is turned off on this device.
class ASH_EXPORT BluetoothDisabledView : public PhoneHubContentView {
......@@ -28,9 +26,6 @@ class ASH_EXPORT BluetoothDisabledView : public PhoneHubContentView {
private:
void LearnMoreButtonPressed();
void ConfirmButtonPressed();
PhoneHubInterstitialView* content_view_ = nullptr;
};
} // namespace ash
......
......@@ -140,11 +140,6 @@ class PhoneHubTrayTest : public AshTestBase {
PhoneHubViewID::kBluetoothDisabledLearnMoreButton));
}
views::Button* bluetooth_disabled_confirm_button() {
return static_cast<views::Button*>(bubble_view()->GetViewByID(
PhoneHubViewID::kBluetoothDisabledConfirmButton));
}
protected:
PhoneHubTray* phone_hub_tray_ = nullptr;
chromeos::phonehub::FakePhoneHubManager phone_hub_manager_;
......@@ -393,7 +388,7 @@ TEST_F(PhoneHubTrayTest, ClickButtonsOnDisconnectedView) {
ClickOnAndWait(disconnected_learn_more_button());
}
TEST_F(PhoneHubTrayTest, ClickButtonsOnBluetoothDisabledView) {
TEST_F(PhoneHubTrayTest, ClickButtonOnBluetoothDisabledView) {
// Simulate a Bluetooth unavailable state.
GetFeatureStatusProvider()->SetStatus(
chromeos::phonehub::FeatureStatus::kUnavailableBluetoothOff);
......@@ -411,12 +406,6 @@ TEST_F(PhoneHubTrayTest, ClickButtonsOnBluetoothDisabledView) {
});
// Simulate a click on "Learn more" button.
ClickOnAndWait(bluetooth_disabled_learn_more_button());
// Simulate a click on "Ok, got it" button.
ClickOnAndWait(bluetooth_disabled_confirm_button());
// Clicking "Ok, got it" button should dimiss the bubble.
EXPECT_FALSE(phone_hub_tray_->GetBubbleView());
}
} // namespace ash
......@@ -35,7 +35,6 @@ enum PhoneHubViewID {
// Bluetooth disabled view and its components.
kBluetoothDisabledView,
kBluetoothDisabledLearnMoreButton,
kBluetoothDisabledConfirmButton,
kPhoneConnectedView,
kInitialConnectingView,
......
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