Commit 0a2ceee2 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Chromium LUCI CQ

[CrOS PhoneHub] Use real "learn more" URL

This CL creates url_constants.h/cc files in //chromeos/components, where
they can be accessed from both //ash and //chrome, and removes constants
which were previously in both those spots.

Note that the content at that URL does not yet contain Phone Hub
information; this will be added before launch.

Fixed: 1144053
Bug: 1106937
Change-Id: I434d2b42b54b64ea299aaace97e12c5b53af7410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2605613
Auto-Submit: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839631}
parent dabe826e
......@@ -17,6 +17,7 @@
#include "ash/system/phonehub/phone_hub_view_ids.h"
#include "ash/system/phonehub/ui_constants.h"
#include "ash/system/status_area_widget.h"
#include "chromeos/components/phonehub/url_constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/chromeos/devicetype_utils.h"
......@@ -71,7 +72,8 @@ phone_hub_metrics::Screen BluetoothDisabledView::GetScreenForMetrics() const {
void BluetoothDisabledView::LearnMoreButtonPressed() {
LogInterstitialScreenEvent(InterstitialScreenEvent::kLearnMore);
NewWindowDelegate::GetInstance()->NewTabWithUrl(
GURL(kLearnMoreUrl), /*from_user_interaction=*/true);
GURL(chromeos::phonehub::kPhoneHubLearnMoreLink),
/*from_user_interaction=*/true);
}
BEGIN_METADATA(BluetoothDisabledView, views::View)
......
......@@ -16,6 +16,7 @@
#include "ash/system/phonehub/phone_hub_view_ids.h"
#include "ash/system/phonehub/ui_constants.h"
#include "chromeos/components/phonehub/connection_scheduler.h"
#include "chromeos/components/phonehub/url_constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/layout/fill_layout.h"
......@@ -53,7 +54,8 @@ PhoneDisconnectedView::PhoneDisconnectedView(
base::BindRepeating(
&NewWindowDelegate::NewTabWithUrl,
base::Unretained(NewWindowDelegate::GetInstance()),
GURL(kLearnMoreUrl), /*from_user_interaction=*/true)),
GURL(chromeos::phonehub::kPhoneHubLearnMoreLink),
/*from_user_interaction=*/true)),
l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_PHONE_DISCONNECTED_DIALOG_LEARN_MORE_BUTTON),
/*paint_background=*/false);
......
......@@ -417,7 +417,7 @@ TEST_F(PhoneHubTrayTest, ClickButtonsOnDisconnectedView) {
// article in a browser tab.
EXPECT_CALL(new_window_delegate(), NewTabWithUrl)
.WillOnce([](const GURL& url, bool from_user_interaction) {
EXPECT_EQ(GURL("https://support.google.com/chromebook/?p=multi_device"),
EXPECT_EQ(GURL("https://support.google.com/chromebook?p=phone_hub"),
url);
EXPECT_TRUE(from_user_interaction);
});
......@@ -438,7 +438,7 @@ TEST_F(PhoneHubTrayTest, ClickButtonOnBluetoothDisabledView) {
// article in a browser tab.
EXPECT_CALL(new_window_delegate(), NewTabWithUrl)
.WillOnce([](const GURL& url, bool from_user_interaction) {
EXPECT_EQ(GURL("https://support.google.com/chromebook/?p=multi_device"),
EXPECT_EQ(GURL("https://support.google.com/chromebook?p=phone_hub"),
url);
EXPECT_TRUE(from_user_interaction);
});
......
......@@ -11,11 +11,6 @@ namespace ash {
constexpr int kBubbleHorizontalSidePaddingDip = 16;
constexpr int kBubbleBottomPaddingDip = 16;
// URLs.
// TODO(meilinw): replace it with the real one.
constexpr char kLearnMoreUrl[] =
"https://support.google.com/chromebook/?p=multi_device";
} // namespace ash
#endif // ASH_SYSTEM_PHONEHUB_UI_CONSTANTS_H_
......@@ -20,6 +20,7 @@
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/components/phonehub/phone_hub_manager.h"
#include "chromeos/components/phonehub/url_constants.h"
#include "chromeos/constants/chromeos_features.h"
#include "chromeos/services/multidevice_setup/public/cpp/prefs.h"
#include "chromeos/services/multidevice_setup/public/cpp/url_provider.h"
......@@ -420,15 +421,11 @@ void MultiDeviceSection::AddLoadTimeData(
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_PHONE_HUB_NOTIFICATIONS_SUMMARY,
ui::GetChromeOSDeviceName()));
// TODO(https://crbug.com/1144053): Replace with updated URL.
html_source->AddString(
"multideviceNotificationAccessSetupAccessProhibitedSummary",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_ACCESS_PROHIBITED_SUMMARY,
base::UTF8ToUTF16(
multidevice_setup::
GetBoardSpecificBetterTogetherSuiteLearnMoreUrl()
.spec())));
GetHelpUrlWithBoard(phonehub::kPhoneHubLearnMoreLink)));
html_source->AddString(
"multideviceWifiSyncItemSummary",
l10n_util::GetStringFUTF16(
......@@ -443,7 +440,7 @@ void MultiDeviceSection::AddLoadTimeData(
"multidevicePhoneHubTaskContinuationDisabledSummary",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_PHONE_HUB_TASK_CONTINUATION_DISABLED_SUMMARY,
GetHelpUrlWithBoard(chrome::kPhoneHubLearnMoreLink)));
GetHelpUrlWithBoard(phonehub::kPhoneHubLearnMoreLink)));
AddEasyUnlockStrings(html_source);
::settings::AddNearbyShareData(html_source);
......
......@@ -398,9 +398,6 @@ const char kOemEulaURLPath[] = "oem";
const char kOnlineEulaURLPath[] =
"https://policies.google.com/terms/embedded?hl=%s";
const char kPhoneHubLearnMoreLink[] =
"https://support.google.com/chromebook?p=phone_hub";
const char kAdditionalToSOnlineURLPath[] =
"https://www.google.com/intl/%s/chrome/terms/";
......
......@@ -364,9 +364,6 @@ extern const char kArcPrivacyPolicyURLPath[];
extern const char kOnlineEulaURLPath[];
// The URL for the help center article about PhoneHub.
extern const char kPhoneHubLearnMoreLink[];
extern const char kAdditionalToSOnlineURLPath[];
// The URL for the "learn more" link for TPM firmware update.
......
......@@ -82,6 +82,8 @@ static_library("phonehub") {
"tether_controller.h",
"tether_controller_impl.cc",
"tether_controller_impl.h",
"url_constants.cc",
"url_constants.h",
"user_action_recorder.h",
"user_action_recorder_impl.cc",
"user_action_recorder_impl.h",
......
// Copyright 2020 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 "chromeos/components/phonehub/url_constants.h"
namespace chromeos {
namespace phonehub {
const char kPhoneHubLearnMoreLink[] =
"https://support.google.com/chromebook?p=phone_hub";
} // namespace phonehub
} // namespace chromeos
// Copyright 2020 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.
#ifndef CHROMEOS_COMPONENTS_PHONEHUB_URL_CONSTANTS_H_
#define CHROMEOS_COMPONENTS_PHONEHUB_URL_CONSTANTS_H_
namespace chromeos {
namespace phonehub {
// The URL for the help center article about Phone Hub.
extern const char kPhoneHubLearnMoreLink[];
} // namespace phonehub
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_PHONEHUB_URL_CONSTANTS_H_
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