Commit 84dd0aa6 authored by Meilin Wang's avatar Meilin Wang Committed by Commit Bot

[CrOS PhoneHub] Update buttons to spec.

This CL removes buttons on initial connecting UI and reconnecting UI to
reflect the spec change.

Screenshots:
https://screenshot.googleplex.com/A6TprYL3kKm2q29.png
https://screenshot.googleplex.com/AdmCtFgv4RqfMow.png

BUG=1106937,1126208

Change-Id: Iff74b3168d6af80f17debf7be39af394e52da161
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438983
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812538}
parent a3f177dc
......@@ -1071,9 +1071,6 @@ This file contains the strings for ash.
<message name="IDS_ASH_PHONE_HUB_INITIAL_CONNECTING_DIALOG_DESCRIPTION" desc="The description of the onboarding dialog that indicates the device is trying to connect to your phone after the user has opted in the Phone Hub feature." translateable="false">
Make sure your phone is nearby with Bluetooth and Wi-Fi turned on.
</message>
<message name="IDS_ASH_PHONE_HUB_INITIAL_CONNECTING_DIALOG_CANCEL_BUTTON" desc="Cancel button on the initial connecting dialog to cancel the connection attempt to your phone.">
Cancel
</message>
<message name="IDS_ASH_PHONE_HUB_CONNECTION_ERROR_DIALOG_TITLE" desc="The title of the dialog that pops up when the Phone Hub feature is not available because there is currently no active connection to the phone.">
Uh Oh! Can’t find phone
</message>
......
37ef1138ef0c954ba56d19bd8c3911463e2a7701
\ No newline at end of file
......@@ -45,7 +45,10 @@ ConnectionErrorView::ConnectionErrorView(ErrorStatus error) {
content_view_->SetDescription(l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_CONNECTION_ERROR_DIALOG_DESCRIPTION));
// Add "Learn more" and "Refresh" buttons.
if (error == ErrorStatus::kReconnecting)
return;
// Add "Learn more" and "Refresh" buttons only for disconnected state.
auto learn_more = std::make_unique<views::LabelButton>(
this, l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_CONNECTION_ERROR_DIALOG_LEARN_MORE_BUTTON));
......
......@@ -6,17 +6,13 @@
#include <algorithm>
#include <memory>
#include <vector>
#include "ash/public/cpp/resources/grit/ash_public_unscaled_resources.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/system/phonehub/phone_hub_interstitial_view.h"
#include "base/strings/string16.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/fill_layout.h"
namespace ash {
......@@ -35,23 +31,10 @@ InitialConnectingView::InitialConnectingView() {
IDS_ASH_PHONE_HUB_INITIAL_CONNECTING_DIALOG_TITLE));
content_view_->SetDescription(l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_INITIAL_CONNECTING_DIALOG_DESCRIPTION));
// Add "Cancel" button for canceling the connection attempt.
auto cancel = std::make_unique<views::LabelButton>(
this, l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_INITIAL_CONNECTING_DIALOG_CANCEL_BUTTON));
cancel->SetEnabledTextColors(AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
content_view_->AddButton(std::move(cancel));
}
InitialConnectingView::~InitialConnectingView() = default;
void InitialConnectingView::ButtonPressed(views::Button* sender,
const ui::Event& event) {
// TODO(meilinw): implement button pressed actions.
}
BEGIN_METADATA(InitialConnectingView, views::View)
END_METADATA
......
......@@ -6,8 +6,8 @@
#define ASH_SYSTEM_PHONEHUB_INITIAL_CONNECTING_VIEW_H_
#include "ash/ash_export.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/view.h"
namespace ash {
......@@ -16,8 +16,7 @@ class PhoneHubInterstitialView;
// An interstitial view representing this device is trying to connect to your
// phone after the user has opted in the Phone Hub feature through the
// onboarding UI.
class ASH_EXPORT InitialConnectingView : public views::View,
public views::ButtonListener {
class ASH_EXPORT InitialConnectingView : public views::View {
public:
METADATA_HEADER(InitialConnectingView);
......@@ -26,9 +25,6 @@ class ASH_EXPORT InitialConnectingView : public views::View,
InitialConnectingView& operator=(const InitialConnectingView&) = delete;
~InitialConnectingView() override;
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
private:
// Responsible for displaying the connecting UI contents.
// Owned by view hierarchy.
......
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