Commit c1ff8a6a authored by Luum Habtemariam's avatar Luum Habtemariam Committed by Commit Bot

CupsProxyService feature flag

This change adds service startup logic based on the already landed
kCrosVmCupsProxy feature flag, disabled by default.

Bug: chromium:945409
Test: manually confirmed correct flag behavior
Change-Id: I6198cfcf4011c557b09d74d33f241cc61629d4ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713237
Commit-Queue: Luum Habtemariam <luum@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682401}
parent 8627e9e8
......@@ -6,8 +6,10 @@
#include <memory>
#include "base/feature_list.h"
#include "chrome/browser/chromeos/printing/cups_proxy_service_delegate_impl.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_features.h"
#include "chrome/services/cups_proxy/public/mojom/constants.mojom.h"
#include "chromeos/dbus/cups_proxy/cups_proxy_client.h"
#include "content/public/browser/browser_context.h"
......@@ -16,8 +18,12 @@
namespace chromeos {
CupsProxyServiceManager::CupsProxyServiceManager() : weak_factory_(this) {
CupsProxyClient::Get()->WaitForServiceToBeAvailable(base::BindOnce(
&CupsProxyServiceManager::OnDaemonAvailable, weak_factory_.GetWeakPtr()));
// Don't wait for the daemon if the feature is turned off anyway.
if (base::FeatureList::IsEnabled(features::kCrosVmCupsProxy)) {
CupsProxyClient::Get()->WaitForServiceToBeAvailable(
base::BindOnce(&CupsProxyServiceManager::OnDaemonAvailable,
weak_factory_.GetWeakPtr()));
}
}
CupsProxyServiceManager::~CupsProxyServiceManager() = default;
......
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