Skip to content

Commit

Permalink
Revert "ambient: Use different backend servers"
Browse files Browse the repository at this point in the history
This reverts commit c8d093a.

Reason for revert: Test failures on ChromeOS https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/7829

Original change's description:
> ambient: Use different backend servers
> 
> This patch configs the dev channel to use testing server. But users can
> overwrite it with a flag.
> 
> Bug: b/148692733
> Test: manual
> Change-Id: I967281bc1421c37d9c1ff74a0815d6a6da570da3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2342134
> Commit-Queue: Tao Wu <wutao@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#799318}

TBR=xiyuan@chromium.org,xiaohuic@chromium.org,wutao@chromium.org

Change-Id: Ic364ef7c1f701b7a36b6503e8d330995de5dcecb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/148692733
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363508
Reviewed-by: Hajime Hoshi <hajimehoshi@chromium.org>
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799491}
  • Loading branch information
Hajime Hoshi authored and Commit Bot committed Aug 19, 2020
1 parent e384305 commit 8fb6951
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 42 deletions.
5 changes: 1 addition & 4 deletions ash/ambient/backdrop/ambient_backend_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ class BackdropURLLoader {
scoped_refptr<network::SharedURLLoaderFactory> loader_factory_;
};

AmbientBackendControllerImpl::AmbientBackendControllerImpl()
: backdrop_client_config_(ash::AmbientClient::Get()->ShouldUseProdServer()
? BackdropClientConfig::ServerType::kProd
: BackdropClientConfig::ServerType::kDev) {}
AmbientBackendControllerImpl::AmbientBackendControllerImpl() = default;

AmbientBackendControllerImpl::~AmbientBackendControllerImpl() = default;

Expand Down
3 changes: 0 additions & 3 deletions ash/public/cpp/ambient/ambient_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class ASH_PUBLIC_EXPORT AmbientClient {
virtual void RequestWakeLockProvider(
mojo::PendingReceiver<device::mojom::WakeLockProvider> receiver) = 0;

// Whether to use backend production server.
virtual bool ShouldUseProdServer() = 0;

protected:
AmbientClient();
AmbientClient(const AmbientClient&) = delete;
Expand Down
4 changes: 0 additions & 4 deletions ash/public/cpp/test/test_ambient_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ void TestAmbientClient::IssueAccessToken(const std::string& access_token,
}
}

bool TestAmbientClient::ShouldUseProdServer() {
return false;
}

bool TestAmbientClient::IsAccessTokenRequestPending() const {
return !!pending_callback_;
}
Expand Down
1 change: 0 additions & 1 deletion ash/public/cpp/test/test_ambient_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class ASH_PUBLIC_EXPORT TestAmbientClient : public AmbientClient {
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
void RequestWakeLockProvider(
mojo::PendingReceiver<device::mojom::WakeLockProvider> receiver) override;
bool ShouldUseProdServer() override;

// Simulate to issue an |access_token|.
// If |with_error| is true, will return an empty access token.
Expand Down
11 changes: 0 additions & 11 deletions chrome/browser/ui/ash/ambient/ambient_client_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/common/channel_info.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/account_id/account_id.h"
#include "components/prefs/pref_service.h"
Expand All @@ -24,7 +23,6 @@
#include "components/signin/public/identity_manager/scope_set.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "components/version_info/channel.h"
#include "content/public/browser/device_service.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/google_service_auth_error.h"
Expand Down Expand Up @@ -166,12 +164,3 @@ void AmbientClientImpl::GetAccessToken(
/*expiration_time=*/base::Time::Now());
}
}

bool AmbientClientImpl::ShouldUseProdServer() {
if (chromeos::features::IsAmbientModeDevUseProdEnabled())
return true;

auto channel = chrome::GetChannel();
return channel == version_info::Channel::STABLE ||
channel == version_info::Channel::BETA;
}
1 change: 0 additions & 1 deletion chrome/browser/ui/ash/ambient/ambient_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class AmbientClientImpl : public ash::AmbientClient {
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
void RequestWakeLockProvider(
mojo::PendingReceiver<device::mojom::WakeLockProvider> receiver) override;
bool ShouldUseProdServer() override;

private:
void GetAccessToken(GetAccessTokenCallback callback,
Expand Down
12 changes: 6 additions & 6 deletions chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
cast_config_controller_media_router_ =
std::make_unique<CastConfigControllerMediaRouter>();

// Needed by AmbientController in ash.
if (chromeos::features::IsAmbientModeEnabled())
ambient_client_ = std::make_unique<AmbientClientImpl>();

ash_shell_init_ = std::make_unique<AshShellInit>();

screen_orientation_delegate_ =
Expand Down Expand Up @@ -211,6 +207,9 @@ void ChromeBrowserMainExtraPartsAsh::PostProfileInit() {

void ChromeBrowserMainExtraPartsAsh::PostBrowserStart() {
mobile_data_notifications_ = std::make_unique<MobileDataNotifications>();

if (chromeos::features::IsAmbientModeEnabled())
ambient_client_ = std::make_unique<AmbientClientImpl>();
}

void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
Expand All @@ -220,6 +219,9 @@ void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
exo_parts_.reset();
#endif

if (chromeos::features::IsAmbientModeEnabled())
ambient_client_.reset();

night_light_client_.reset();
mobile_data_notifications_.reset();
chrome_launcher_controller_initializer_.reset();
Expand All @@ -244,8 +246,6 @@ void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
// needs to be released before destroying the profile.
app_list_client_.reset();
ash_shell_init_.reset();
ambient_client_.reset();

cast_config_controller_media_router_.reset();
if (chromeos::NetworkConnect::IsInitialized())
chromeos::NetworkConnect::Shutdown();
Expand Down
9 changes: 0 additions & 9 deletions chromeos/constants/chromeos_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ const base::Feature kAmbientModeFeature{"ChromeOSAmbientMode",
const base::Feature kAmbientModePhotoPreviewFeature{
"ChromeOSAmbientModePhotoPreview", base::FEATURE_DISABLED_BY_DEFAULT};

// Controls whether to allow Dev channel to use Prod server feature.
const base::Feature kAmbientModeDevUseProdFeature{
"ChromeOSAmbientModeDevChannelUseProdServer",
base::FEATURE_DISABLED_BY_DEFAULT};

// Controls whether to enable ARC ADB sideloading support.
const base::Feature kArcAdbSideloadingFeature{
"ArcAdbSideloading", base::FEATURE_DISABLED_BY_DEFAULT};
Expand Down Expand Up @@ -539,10 +534,6 @@ bool IsAmbientModePhotoPreviewEnabled() {
return base::FeatureList::IsEnabled(kAmbientModePhotoPreviewFeature);
}

bool IsAmbientModeDevUseProdEnabled() {
return base::FeatureList::IsEnabled(kAmbientModeDevUseProdFeature);
}

bool IsBetterUpdateEnabled() {
return base::FeatureList::IsEnabled(kBetterUpdateScreen);
}
Expand Down
3 changes: 0 additions & 3 deletions chromeos/constants/chromeos_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ extern const base::Feature kAmbientModeFeature;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kAmbientModePhotoPreviewFeature;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kAmbientModeDevUseProdFeature;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kArcAdbSideloadingFeature;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kArcManagedAdbSideloadingSupport;
Expand Down Expand Up @@ -234,7 +232,6 @@ extern const base::Feature kImeMozcProto;

COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsAmbientModeEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsAmbientModePhotoPreviewEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsAmbientModeDevUseProdEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsAssistantEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsBetterUpdateEnabled();
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsChildSpecificSigninEnabled();
Expand Down

0 comments on commit 8fb6951

Please sign in to comment.