Commit 1e0c025c authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Cleanup some usage of IsAshInBrowserProcess

We need to distinguish between MultiProcessMash, SingleProcessMash and
both (aka IsUsingWindowService). Clean up some usage in login and
accessibility.

Bug: 874468
Change-Id: Ibf9694f45114491bf54b232a906b6a5a390e3f05
Reviewed-on: https://chromium-review.googlesource.com/1180344
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584613}
parent e6450a95
...@@ -67,7 +67,7 @@ void RegisterOutOfProcessServices( ...@@ -67,7 +67,7 @@ void RegisterOutOfProcessServices(
ContentBrowserClient::OutOfProcessServiceMap* services) { ContentBrowserClient::OutOfProcessServiceMap* services) {
RegisterOutOfProcessServicesImpl(kCommonServices, base::size(kCommonServices), RegisterOutOfProcessServicesImpl(kCommonServices, base::size(kCommonServices),
services); services);
if (!features::IsAshInBrowserProcess()) { if (features::IsMultiProcessMash()) {
RegisterOutOfProcessServicesImpl(kMashServices, base::size(kMashServices), RegisterOutOfProcessServicesImpl(kMashServices, base::size(kMashServices),
services); services);
} }
...@@ -97,7 +97,7 @@ void RegisterInProcessServices( ...@@ -97,7 +97,7 @@ void RegisterInProcessServices(
(*services)[ax::mojom::kAXHostServiceName] = info; (*services)[ax::mojom::kAXHostServiceName] = info;
} }
if (!features::IsAshInBrowserProcess()) if (features::IsMultiProcessMash())
return; return;
(*services)[ash::mojom::kServiceName] = (*services)[ash::mojom::kServiceName] =
......
...@@ -208,7 +208,7 @@ void BrowserProcessPlatformPart::DestroySystemClock() { ...@@ -208,7 +208,7 @@ void BrowserProcessPlatformPart::DestroySystemClock() {
ui::InputDeviceControllerClient* ui::InputDeviceControllerClient*
BrowserProcessPlatformPart::GetInputDeviceControllerClient() { BrowserProcessPlatformPart::GetInputDeviceControllerClient() {
if (!input_device_controller_client_) { if (!input_device_controller_client_) {
const std::string service_name = features::IsAshInBrowserProcess() const std::string service_name = !features::IsMultiProcessMash()
? chromeos::kChromeServiceName ? chromeos::kChromeServiceName
: ui::mojom::kServiceName; : ui::mojom::kServiceName;
input_device_controller_client_ = input_device_controller_client_ =
......
...@@ -333,7 +333,7 @@ void AccessibilityManager::UpdateAlwaysShowMenuFromPref() { ...@@ -333,7 +333,7 @@ void AccessibilityManager::UpdateAlwaysShowMenuFromPref() {
return; return;
// TODO(crbug.com/594887): Fix for mash by moving pref into ash. // TODO(crbug.com/594887): Fix for mash by moving pref into ash.
if (!features::IsAshInBrowserProcess()) if (features::IsMultiProcessMash())
return; return;
// Update system tray menu visibility. // Update system tray menu visibility.
...@@ -881,8 +881,8 @@ void AccessibilityManager::InputMethodChanged( ...@@ -881,8 +881,8 @@ void AccessibilityManager::InputMethodChanged(
Profile* /* profile */, Profile* /* profile */,
bool show_message) { bool show_message) {
// Sticky keys is implemented only in ash. // Sticky keys is implemented only in ash.
// TODO(dpolukhin): support Athena, crbug.com/408733. // TODO(crbug.com/678820): Mash support.
if (features::IsAshInBrowserProcess()) { if (!features::IsMultiProcessMash()) {
ash::Shell::Get()->sticky_keys_controller()->SetModifiersEnabled( ash::Shell::Get()->sticky_keys_controller()->SetModifiersEnabled(
manager->IsISOLevel5ShiftUsedByCurrentInputMethod(), manager->IsISOLevel5ShiftUsedByCurrentInputMethod(),
manager->IsAltGrUsedByCurrentInputMethod()); manager->IsAltGrUsedByCurrentInputMethod());
...@@ -1043,7 +1043,7 @@ void AccessibilityManager::NotifyAccessibilityStatusChanged( ...@@ -1043,7 +1043,7 @@ void AccessibilityManager::NotifyAccessibilityStatusChanged(
callback_list_.Notify(details); callback_list_.Notify(details);
// TODO(crbug.com/594887): Fix for mash by moving pref into ash. // TODO(crbug.com/594887): Fix for mash by moving pref into ash.
if (!features::IsAshInBrowserProcess()) if (features::IsMultiProcessMash())
return; return;
if (details.notification_type == ACCESSIBILITY_TOGGLE_DICTATION) { if (details.notification_type == ACCESSIBILITY_TOGGLE_DICTATION) {
......
...@@ -78,7 +78,7 @@ AccessibilityPanel::AccessibilityPanel(content::BrowserContext* browser_context, ...@@ -78,7 +78,7 @@ AccessibilityPanel::AccessibilityPanel(content::BrowserContext* browser_context,
// TODO(jamescook|fsamuel): Fix this. It causes a white flash when opening the // TODO(jamescook|fsamuel): Fix this. It causes a white flash when opening the
// window. The underlying problem is FrameToken plumbing, see // window. The underlying problem is FrameToken plumbing, see
// ui::ws::ServerWindow::OnFrameTokenChanged. https://crbug.com/771331 // ui::ws::ServerWindow::OnFrameTokenChanged. https://crbug.com/771331
if (!features::IsAshInBrowserProcess()) if (features::IsMultiProcessMash())
widget_->Show(); widget_->Show();
} }
......
...@@ -322,7 +322,7 @@ class DBusServices { ...@@ -322,7 +322,7 @@ class DBusServices {
DBusThreadManager::Get()->GetSystemBus(), DBusThreadManager::Get()->GetSystemBus(),
chromeos::DBusThreadManager::Get()->IsUsingFakes()); chromeos::DBusThreadManager::Get()->IsUsingFakes());
if (features::IsAshInBrowserProcess()) { if (!features::IsMultiProcessMash()) {
// In Mash, power policy is sent to powerd by ash. // In Mash, power policy is sent to powerd by ash.
PowerPolicyController::Initialize( PowerPolicyController::Initialize(
DBusThreadManager::Get()->GetPowerManagerClient()); DBusThreadManager::Get()->GetPowerManagerClient());
...@@ -424,7 +424,7 @@ class DBusServices { ...@@ -424,7 +424,7 @@ class DBusServices {
drive_file_stream_service_.reset(); drive_file_stream_service_.reset();
ProcessDataCollector::Shutdown(); ProcessDataCollector::Shutdown();
PowerDataCollector::Shutdown(); PowerDataCollector::Shutdown();
if (features::IsAshInBrowserProcess()) if (!features::IsMultiProcessMash())
PowerPolicyController::Shutdown(); PowerPolicyController::Shutdown();
device::BluetoothAdapterFactory::Shutdown(); device::BluetoothAdapterFactory::Shutdown();
bluez::BluezDBusManager::Shutdown(); bluez::BluezDBusManager::Shutdown();
...@@ -752,13 +752,10 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() { ...@@ -752,13 +752,10 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() {
AccessibilityManager::Initialize(); AccessibilityManager::Initialize();
if (features::IsAshInBrowserProcess()) { if (!features::IsMultiProcessMash()) {
// Initialize magnification manager before ash tray is created. And this // Initialize magnification manager before ash tray is created. And this
// must be placed after UserManager::SessionStarted(); // must be placed after UserManager::SessionStarted();
// TODO(sad): These components expects the ash::Shell instance to be // TODO(crbug.com/821551): Mash support.
// created. However, when running as a mus-client, an ash::Shell instance is
// not created. These accessibility services should instead be exposed as
// separate services. crbug.com/557401
MagnificationManager::Initialize(); MagnificationManager::Initialize();
} }
...@@ -1027,7 +1024,7 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() { ...@@ -1027,7 +1024,7 @@ void ChromeBrowserMainPartsChromeos::PostBrowserStart() {
spoken_feedback_event_rewriter_delegate_ = spoken_feedback_event_rewriter_delegate_ =
std::make_unique<SpokenFeedbackEventRewriterDelegate>(); std::make_unique<SpokenFeedbackEventRewriterDelegate>();
if (features::IsAshInBrowserProcess()) { if (!features::IsMultiProcessMash()) {
// TODO(mash): Support EventRewriterController; see crbug.com/647781 // TODO(mash): Support EventRewriterController; see crbug.com/647781
ash::EventRewriterController* event_rewriter_controller = ash::EventRewriterController* event_rewriter_controller =
ash::Shell::Get()->event_rewriter_controller(); ash::Shell::Get()->event_rewriter_controller();
...@@ -1117,7 +1114,7 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { ...@@ -1117,7 +1114,7 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
// Detach D-Bus clients before DBusThreadManager is shut down. // Detach D-Bus clients before DBusThreadManager is shut down.
idle_action_warning_observer_.reset(); idle_action_warning_observer_.reset();
if (features::IsAshInBrowserProcess()) if (!features::IsMultiProcessMash())
MagnificationManager::Shutdown(); MagnificationManager::Shutdown();
media::SoundsManager::Shutdown(); media::SoundsManager::Shutdown();
...@@ -1165,7 +1162,8 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() { ...@@ -1165,7 +1162,8 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
// ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(). // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun().
arc_service_launcher_.reset(); arc_service_launcher_.reset();
if (features::IsAshInBrowserProcess()) // TODO(crbug.com/594887): Mash support.
if (!features::IsMultiProcessMash())
AccessibilityManager::Shutdown(); AccessibilityManager::Shutdown();
input_method::Shutdown(); input_method::Shutdown();
......
...@@ -77,7 +77,7 @@ bool WebUIScreenLocker::ShouldPreloadLockScreen() { ...@@ -77,7 +77,7 @@ bool WebUIScreenLocker::ShouldPreloadLockScreen() {
// Bail for mash because IdleDetector/UserActivityDetector does not work // Bail for mash because IdleDetector/UserActivityDetector does not work
// properly there. // properly there.
// TODO(xiyuan): Revisit after http://crbug.com/626899. // TODO(xiyuan): Revisit after http://crbug.com/626899.
if (!features::IsAshInBrowserProcess()) if (features::IsMultiProcessMash())
return false; return false;
Profile* profile = ProfileHelper::Get()->GetProfileByUser( Profile* profile = ProfileHelper::Get()->GetProfileByUser(
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
namespace chromeos { namespace chromeos {
InputEventsBlocker::InputEventsBlocker() { InputEventsBlocker::InputEventsBlocker() {
// TODO(mash): Implement a mash version. This will probably need to talk to // TODO(crbug.com/854323): Mash support. Needs mojo API, or to move to ash.
// the window server. if (!features::IsMultiProcessMash()) {
if (features::IsAshInBrowserProcess()) {
ash::Shell::Get()->AddPreTargetHandler(this, ash::Shell::Get()->AddPreTargetHandler(this,
ui::EventTarget::Priority::kSystem); ui::EventTarget::Priority::kSystem);
VLOG(1) << "InputEventsBlocker " << this << " created."; VLOG(1) << "InputEventsBlocker " << this << " created.";
...@@ -24,7 +23,7 @@ InputEventsBlocker::InputEventsBlocker() { ...@@ -24,7 +23,7 @@ InputEventsBlocker::InputEventsBlocker() {
} }
InputEventsBlocker::~InputEventsBlocker() { InputEventsBlocker::~InputEventsBlocker() {
if (features::IsAshInBrowserProcess()) { if (!features::IsMultiProcessMash()) {
ash::Shell::Get()->RemovePreTargetHandler(this); ash::Shell::Get()->RemovePreTargetHandler(this);
VLOG(1) << "InputEventsBlocker " << this << " destroyed."; VLOG(1) << "InputEventsBlocker " << this << " destroyed.";
} else { } else {
......
...@@ -49,7 +49,8 @@ LoginDisplayHostCommon::LoginDisplayHostCommon() : weak_factory_(this) { ...@@ -49,7 +49,8 @@ LoginDisplayHostCommon::LoginDisplayHostCommon() : weak_factory_(this) {
// Disable Drag'n'Drop for the login session. // Disable Drag'n'Drop for the login session.
// ash::Shell may be null in tests. // ash::Shell may be null in tests.
if (ash::Shell::HasInstance() && features::IsAshInBrowserProcess()) { // TODO(crbug.com/854328): Mash support.
if (ash::Shell::HasInstance() && !features::IsUsingWindowService()) {
scoped_drag_drop_disabler_.reset( scoped_drag_drop_disabler_.reset(
new wm::ScopedDragDropDisabler(ash::Shell::GetPrimaryRootWindow())); new wm::ScopedDragDropDisabler(ash::Shell::GetPrimaryRootWindow()));
} else { } else {
......
...@@ -408,7 +408,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate ...@@ -408,7 +408,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate
// * Ash crash at the login screen on mustash // * Ash crash at the login screen on mustash
// In the latter case the mash root process will trigger a clean restart // In the latter case the mash root process will trigger a clean restart
// of content_browser. // of content_browser.
if (!features::IsAshInBrowserProcess() && login_display_host_) if (features::IsUsingWindowService() && login_display_host_)
login_display_host_->ResetLoginWindowAndView(); login_display_host_->ResetLoginWindowAndView();
} }
void DeleteDelegate() override { delete this; } void DeleteDelegate() override { delete this; }
...@@ -431,7 +431,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate ...@@ -431,7 +431,7 @@ class LoginDisplayHostWebUI::LoginWidgetDelegate
LoginDisplayHostWebUI::LoginDisplayHostWebUI() LoginDisplayHostWebUI::LoginDisplayHostWebUI()
: oobe_startup_sound_played_(StartupUtils::IsOobeCompleted()), : oobe_startup_sound_played_(StartupUtils::IsOobeCompleted()),
weak_factory_(this) { weak_factory_(this) {
if (!features::IsAshInBrowserProcess()) { if (features::IsUsingWindowService()) {
// Animation, and initializing hidden, are not currently supported for Mash. // Animation, and initializing hidden, are not currently supported for Mash.
finalize_animation_type_ = ANIMATION_NONE; finalize_animation_type_ = ANIMATION_NONE;
initialize_webui_hidden_ = false; initialize_webui_hidden_ = false;
...@@ -450,19 +450,19 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI() ...@@ -450,19 +450,19 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI()
bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
// Mash always runs login screen with zero delay // Mash always runs login screen with zero delay
if (!features::IsAshInBrowserProcess()) if (features::IsUsingWindowService())
zero_delay_enabled = true; zero_delay_enabled = true;
waiting_for_wallpaper_load_ = !zero_delay_enabled; waiting_for_wallpaper_load_ = !zero_delay_enabled;
// Initializing hidden is not supported in Mash // Initializing hidden is not supported in Mash
if (features::IsAshInBrowserProcess()) { if (!features::IsUsingWindowService()) {
initialize_webui_hidden_ = initialize_webui_hidden_ =
kHiddenWebUIInitializationDefault && !zero_delay_enabled; kHiddenWebUIInitializationDefault && !zero_delay_enabled;
} }
// Check if WebUI init type is overriden. Not supported in Mash. // Check if WebUI init type is overriden. Not supported in Mash.
if (features::IsAshInBrowserProcess() && if (!features::IsUsingWindowService() &&
base::CommandLine::ForCurrentProcess()->HasSwitch( base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshWebUIInit)) { switches::kAshWebUIInit)) {
const std::string override_type = const std::string override_type =
...@@ -632,7 +632,7 @@ void LoginDisplayHostWebUI::OnStartUserAdding() { ...@@ -632,7 +632,7 @@ void LoginDisplayHostWebUI::OnStartUserAdding() {
restore_path_ = RESTORE_ADD_USER_INTO_SESSION; restore_path_ = RESTORE_ADD_USER_INTO_SESSION;
// Animation is not supported in Mash // Animation is not supported in Mash
if (features::IsAshInBrowserProcess()) if (!features::IsUsingWindowService())
finalize_animation_type_ = ANIMATION_ADD_USER; finalize_animation_type_ = ANIMATION_ADD_USER;
// Observe the user switch animation and defer the deletion of itself only // Observe the user switch animation and defer the deletion of itself only
// after the animation is finished. // after the animation is finished.
...@@ -648,7 +648,7 @@ void LoginDisplayHostWebUI::OnStartUserAdding() { ...@@ -648,7 +648,7 @@ void LoginDisplayHostWebUI::OnStartUserAdding() {
// We should emit this signal only at login screen (after reboot or sign out). // We should emit this signal only at login screen (after reboot or sign out).
login_view_->set_should_emit_login_prompt_visible(false); login_view_->set_should_emit_login_prompt_visible(false);
if (features::IsAshInBrowserProcess()) { if (!features::IsUsingWindowService()) {
// Lock container can be transparent after lock screen animation. // Lock container can be transparent after lock screen animation.
aura::Window* lock_container = ash::Shell::GetContainer( aura::Window* lock_container = ash::Shell::GetContainer(
ash::Shell::GetPrimaryRootWindow(), ash::Shell::GetPrimaryRootWindow(),
...@@ -689,7 +689,7 @@ void LoginDisplayHostWebUI::OnStartSignInScreen( ...@@ -689,7 +689,7 @@ void LoginDisplayHostWebUI::OnStartSignInScreen(
restore_path_ = RESTORE_SIGN_IN; restore_path_ = RESTORE_SIGN_IN;
is_showing_login_ = true; is_showing_login_ = true;
// Animation is not supported in Mash // Animation is not supported in Mash
if (features::IsAshInBrowserProcess()) if (!features::IsUsingWindowService())
finalize_animation_type_ = ANIMATION_WORKSPACE; finalize_animation_type_ = ANIMATION_WORKSPACE;
if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) { if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) {
...@@ -738,7 +738,7 @@ void LoginDisplayHostWebUI::OnPreferencesChanged() { ...@@ -738,7 +738,7 @@ void LoginDisplayHostWebUI::OnPreferencesChanged() {
void LoginDisplayHostWebUI::OnStartAppLaunch() { void LoginDisplayHostWebUI::OnStartAppLaunch() {
// Animation is not supported in Mash. // Animation is not supported in Mash.
if (features::IsAshInBrowserProcess()) if (!features::IsUsingWindowService())
finalize_animation_type_ = ANIMATION_FADE_OUT; finalize_animation_type_ = ANIMATION_FADE_OUT;
if (!login_window_) if (!login_window_)
LoadURL(GURL(kAppLaunchSplashURL)); LoadURL(GURL(kAppLaunchSplashURL));
...@@ -748,7 +748,7 @@ void LoginDisplayHostWebUI::OnStartAppLaunch() { ...@@ -748,7 +748,7 @@ void LoginDisplayHostWebUI::OnStartAppLaunch() {
void LoginDisplayHostWebUI::OnStartArcKiosk() { void LoginDisplayHostWebUI::OnStartArcKiosk() {
// Animation is not supported in Mash. // Animation is not supported in Mash.
if (features::IsAshInBrowserProcess()) if (!features::IsUsingWindowService())
finalize_animation_type_ = ANIMATION_FADE_OUT; finalize_animation_type_ = ANIMATION_FADE_OUT;
if (!login_window_) { if (!login_window_) {
LoadURL(GURL(kAppLaunchSplashURL)); LoadURL(GURL(kAppLaunchSplashURL));
...@@ -925,7 +925,7 @@ void LoginDisplayHostWebUI::OnUserSwitchAnimationFinished() { ...@@ -925,7 +925,7 @@ void LoginDisplayHostWebUI::OnUserSwitchAnimationFinished() {
// LoginDisplayHostWebUI, private // LoginDisplayHostWebUI, private
void LoginDisplayHostWebUI::ScheduleWorkspaceAnimation() { void LoginDisplayHostWebUI::ScheduleWorkspaceAnimation() {
if (!features::IsAshInBrowserProcess()) { if (features::IsUsingWindowService()) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
return; return;
} }
...@@ -1036,7 +1036,7 @@ void LoginDisplayHostWebUI::InitLoginWindowAndView() { ...@@ -1036,7 +1036,7 @@ void LoginDisplayHostWebUI::InitLoginWindowAndView() {
? ash::kShellWindowId_AlwaysOnTopContainer ? ash::kShellWindowId_AlwaysOnTopContainer
: ash::kShellWindowId_LockScreenContainer; : ash::kShellWindowId_LockScreenContainer;
// The ash::Shell containers are not available in Mash // The ash::Shell containers are not available in Mash
if (features::IsAshInBrowserProcess()) { if (!features::IsUsingWindowService()) {
params.parent = params.parent =
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), container); ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), container);
} else { } else {
...@@ -1056,7 +1056,7 @@ void LoginDisplayHostWebUI::InitLoginWindowAndView() { ...@@ -1056,7 +1056,7 @@ void LoginDisplayHostWebUI::InitLoginWindowAndView() {
// Animations are not available in Mash. // Animations are not available in Mash.
// For voice interaction OOBE, we do not want the animation here. // For voice interaction OOBE, we do not want the animation here.
if (features::IsAshInBrowserProcess() && !is_voice_interaction_oobe_) { if (!features::IsUsingWindowService() && !is_voice_interaction_oobe_) {
login_window_->SetVisibilityAnimationDuration( login_window_->SetVisibilityAnimationDuration(
base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs)); base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
login_window_->SetVisibilityAnimationTransition( login_window_->SetVisibilityAnimationTransition(
...@@ -1089,7 +1089,7 @@ void LoginDisplayHostWebUI::ResetLoginWindowAndView() { ...@@ -1089,7 +1089,7 @@ void LoginDisplayHostWebUI::ResetLoginWindowAndView() {
} }
if (login_window_) { if (login_window_) {
if (!features::IsAshInBrowserProcess()) { if (features::IsUsingWindowService()) {
login_window_->Close(); login_window_->Close();
} else { } else {
login_window_->Hide(); login_window_->Hide();
......
...@@ -40,7 +40,7 @@ void SetupWidgetInitParamsForContainer(views::Widget::InitParams* params, ...@@ -40,7 +40,7 @@ void SetupWidgetInitParamsForContainer(views::Widget::InitParams* params,
DCHECK_GE(container_id, ash::kShellWindowId_MinContainer); DCHECK_GE(container_id, ash::kShellWindowId_MinContainer);
DCHECK_LE(container_id, ash::kShellWindowId_MaxContainer); DCHECK_LE(container_id, ash::kShellWindowId_MaxContainer);
if (!features::IsAshInBrowserProcess()) { if (features::IsUsingWindowService()) {
using ui::mojom::WindowManager; using ui::mojom::WindowManager;
params->mus_properties[WindowManager::kContainerId_InitProperty] = params->mus_properties[WindowManager::kContainerId_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(container_id); mojo::ConvertTo<std::vector<uint8_t>>(container_id);
......
...@@ -133,13 +133,17 @@ const base::Feature kSingleProcessMash = {"SingleProcessMash", ...@@ -133,13 +133,17 @@ const base::Feature kSingleProcessMash = {"SingleProcessMash",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
bool IsUsingWindowService() { bool IsUsingWindowService() {
return IsSingleProcessMash() || !IsAshInBrowserProcess(); return IsSingleProcessMash() || IsMultiProcessMash();
} }
bool IsAshInBrowserProcess() { bool IsAshInBrowserProcess() {
return !base::FeatureList::IsEnabled(features::kMash); return !base::FeatureList::IsEnabled(features::kMash);
} }
bool IsMultiProcessMash() {
return base::FeatureList::IsEnabled(features::kMash);
}
bool IsSingleProcessMash() { bool IsSingleProcessMash() {
return base::FeatureList::IsEnabled(features::kSingleProcessMash); return base::FeatureList::IsEnabled(features::kSingleProcessMash);
} }
......
...@@ -57,8 +57,13 @@ UI_BASE_EXPORT bool IsUsingWindowService(); ...@@ -57,8 +57,13 @@ UI_BASE_EXPORT bool IsUsingWindowService();
// Returns true if ash is in process (the default). A value of false means ash // Returns true if ash is in process (the default). A value of false means ash
// is running in a separate process (and is hosting the UI Service and Viz). // is running in a separate process (and is hosting the UI Service and Viz).
// DEPRECATED: Use !IsMultiProcessMash() or !IsUsingWindowService().
UI_BASE_EXPORT bool IsAshInBrowserProcess(); UI_BASE_EXPORT bool IsAshInBrowserProcess();
// Returns true if ash in running in a separate process (and is hosting the UI
// service and Viz graphics).
UI_BASE_EXPORT bool IsMultiProcessMash();
// Returns true if code outside of ash is using the WindowService. In this mode // Returns true if code outside of ash is using the WindowService. In this mode
// there are two aura::Envs. Ash uses one with Env::Mode::LOCAL. Non-ash code // there are two aura::Envs. Ash uses one with Env::Mode::LOCAL. Non-ash code
// uses an aura::Env with a mode of MUS. The non-ash code using mus targets the // uses an aura::Env with a mode of MUS. The non-ash code using mus targets the
......
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