chromeos: removes usage of ash::Config from chrome/
And instead uses features::IsAshInBrowserProcess(). This is necessary to
support --enable-features=OopAsh and --enable-features=Mash. This also will
allow us to get rid of ash::Config entirely.
BUG=854336
TEST=covered by test
Change-Id: Iddc53634b925e7c30fc33ec52ffa362730ecf59c
Reviewed-on: https://chromium-review.googlesource.com/1108349
Commit-Queue: Scott Violet <[email protected]>
Reviewed-by: Michael Wasserman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#569086}
diff --git a/ash/login/ui/lock_screen.cc b/ash/login/ui/lock_screen.cc
index b177b75..ef3884d 100644
--- a/ash/login/ui/lock_screen.cc
+++ b/ash/login/ui/lock_screen.cc
@@ -73,7 +73,7 @@
CHECK(!instance_);
instance_ = new LockScreen(type);
- instance_->window_ = new LockWindow(Shell::GetAshConfig());
+ instance_->window_ = new LockWindow();
instance_->window_->SetBounds(
display::Screen::GetScreen()->GetPrimaryDisplay().bounds());
diff --git a/ash/login/ui/lock_window.cc b/ash/login/ui/lock_window.cc
index d2dc278..dfe1567 100644
--- a/ash/login/ui/lock_window.cc
+++ b/ash/login/ui/lock_window.cc
@@ -11,7 +11,7 @@
namespace ash {
-LockWindow::LockWindow(Config config) {
+LockWindow::LockWindow() {
ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr);
views::Widget::InitParams params(
diff --git a/ash/login/ui/lock_window.h b/ash/login/ui/lock_window.h
index 78e2529e..7852c36 100644
--- a/ash/login/ui/lock_window.h
+++ b/ash/login/ui/lock_window.h
@@ -18,13 +18,11 @@
namespace ash {
-enum class Config;
-
// Shows the widget for the lock screen.
class ASH_EXPORT LockWindow : public views::Widget,
public views::WidgetDelegate {
public:
- explicit LockWindow(Config config);
+ LockWindow();
~LockWindow() override;
LoginDataDispatcher* data_dispatcher() const {
diff --git a/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc b/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc
index bef00cf..5345f78 100644
--- a/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc
+++ b/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "ui/base/ui_base_features.h"
namespace extensions {
@@ -13,7 +13,7 @@
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest, SendSyntheticKeyEvent) {
// Not yet supported on mash.
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return;
ASSERT_TRUE(RunExtensionSubtest("accessibility_private/",
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index d2fb3a3..c61a9acd 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -145,9 +145,7 @@
#include "chrome/browser/chrome_browser_main_mac.h"
#endif
-#if defined(OS_CHROMEOS)
-#include "chrome/browser/ui/ash/ash_util.h"
-#else
+#if !defined(OS_CHROMEOS)
#include "ui/message_center/message_center.h"
#endif
diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc
index 61447ca..b472611 100644
--- a/chrome/browser/browser_process_platform_part_chromeos.cc
+++ b/chrome/browser/browser_process_platform_part_chromeos.cc
@@ -12,7 +12,6 @@
#include "base/time/tick_clock.h"
#include "chrome/browser/ash_service_registry.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/chrome_service_name.h"
#include "chrome/browser/chromeos/login/session/chrome_session_manager.h"
#include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
@@ -46,6 +45,7 @@
#include "services/ui/public/cpp/input_devices/input_device_controller.h"
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#include "services/ui/public/interfaces/constants.mojom.h"
+#include "ui/base/ui_base_features.h"
BrowserProcessPlatformPart::BrowserProcessPlatformPart()
: created_profile_helper_(false),
@@ -200,10 +200,9 @@
ui::InputDeviceControllerClient*
BrowserProcessPlatformPart::GetInputDeviceControllerClient() {
if (!input_device_controller_client_) {
- const std::string service_name =
- chromeos::GetAshConfig() == ash::Config::CLASSIC
- ? chromeos::kChromeServiceName
- : ui::mojom::kServiceName;
+ const std::string service_name = features::IsAshInBrowserProcess()
+ ? chromeos::kChromeServiceName
+ : ui::mojom::kServiceName;
input_device_controller_client_ =
std::make_unique<ui::InputDeviceControllerClient>(
content::ServiceManagerConnection::GetForProcess()->GetConnector(),
diff --git a/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc b/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc
index 2729fcdb..919e9b8 100644
--- a/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc
+++ b/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc
@@ -10,13 +10,13 @@
#include "base/files/file_util.h"
#include "base/run_loop.h"
#include "base/threading/thread_restrictions.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/common/process_type.h"
+#include "ui/base/ui_base_features.h"
using content::BrowserChildProcessHostIterator;
using content::BrowserThread;
@@ -53,7 +53,7 @@
// Verifies that mash service child processes use in-process breakpad crash
// dumping.
IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientMashTest, CrashReporter) {
- if (chromeos::GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
return;
// Child process management lives on the IO thread.
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index 57cc941..42183e4 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -467,8 +467,6 @@
"arc/voice_interaction/voice_interaction_controller_client.h",
"arc/wallpaper/arc_wallpaper_service.cc",
"arc/wallpaper/arc_wallpaper_service.h",
- "ash_config.cc",
- "ash_config.h",
"attestation/attestation_ca_client.cc",
"attestation/attestation_ca_client.h",
"attestation/attestation_policy_observer.cc",
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
index dae1e72..d0f3242a 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -38,7 +38,6 @@
#include "chrome/browser/chromeos/accessibility/select_to_speak_event_handler.h"
#include "chrome/browser/chromeos/accessibility/switch_access_event_handler.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h"
@@ -81,6 +80,7 @@
#include "ui/accessibility/ax_enum_util.h"
#include "ui/base/ime/chromeos/extension_ime_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_features.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
#include "url/gurl.h"
@@ -320,7 +320,7 @@
return;
// TODO(crbug.com/594887): Fix for mash by moving pref into ash.
- if (GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return;
// Update system tray menu visibility.
@@ -860,7 +860,7 @@
bool show_message) {
// Sticky keys is implemented only in ash.
// TODO(dpolukhin): support Athena, crbug.com/408733.
- if (GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
ash::Shell::Get()->sticky_keys_controller()->SetModifiersEnabled(
manager->IsISOLevel5ShiftUsedByCurrentInputMethod(),
manager->IsAltGrUsedByCurrentInputMethod());
@@ -999,7 +999,7 @@
callback_list_.Notify(details);
// TODO(crbug.com/594887): Fix for mash by moving pref into ash.
- if (GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return;
if (details.notification_type == ACCESSIBILITY_TOGGLE_DICTATION) {
diff --git a/chrome/browser/chromeos/accessibility/chromevox_panel.cc b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
index 58136f63..02756b7 100644
--- a/chrome/browser/chromeos/accessibility/chromevox_panel.cc
+++ b/chrome/browser/chromeos/accessibility/chromevox_panel.cc
@@ -9,7 +9,6 @@
#include "ash/public/interfaces/constants.mojom.h"
#include "base/macros.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/data_use_measurement/data_use_web_contents_observer.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
@@ -19,6 +18,7 @@
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
#include "services/service_manager/public/cpp/connector.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/views/controls/webview/webview.h"
@@ -109,7 +109,7 @@
// TODO(jamescook|fsamuel): Fix this. It causes a white flash when opening the
// window. The underlying problem is FrameToken plumbing, see
// ui::ws::ServerWindow::OnFrameTokenChanged. https://crbug.com/771331
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
widget_->Show();
}
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
index d981eac9..3b84b73c 100644
--- a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
+++ b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
@@ -11,7 +11,6 @@
#include "ash/test/ash_test_helper.h"
#include "ash/test/ash_test_views_delegate.h"
#include "base/macros.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h"
#include "chrome/test/base/testing_profile.h"
#include "ui/aura/test/aura_test_base.h"
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
index 8c8fa051..4690706 100644
--- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
+++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/chromeos/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.h"
#include "chrome/browser/chromeos/arc/voice_interaction/highlighter_controller_client.h"
#include "chrome/browser/chromeos/arc/voice_interaction/voice_interaction_controller_client.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_webui.h"
#include "chrome/browser/profiles/profile.h"
@@ -45,6 +44,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
+#include "ui/base/ui_base_features.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_owner.h"
#include "ui/compositor/layer_tree_owner.h"
@@ -113,7 +113,7 @@
// Exclude metalayer-related layers. This will also include other layers
// under kShellWindowId_OverlayContainer which is fine.
// TODO(crbug.com/757012): Mash support.
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
aura::Window* overlay_container = ash::Shell::GetContainer(
root_window, ash::kShellWindowId_OverlayContainer);
if (overlay_container != nullptr)
@@ -284,7 +284,7 @@
// Since ARC currently only runs in primary display, we restrict
// the screenshot to it.
// TODO(crbug.com/757012): Mash support.
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
std::move(callback).Run(std::vector<uint8_t>{});
return;
}
@@ -576,7 +576,7 @@
bool ArcVoiceInteractionFrameworkService::IsHomescreenActive() {
// Homescreen is considered to be active if there are no active windows.
// TODO(crbug.com/757012): Mash support.
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return false;
return !ash::Shell::Get()->activation_client()->GetActiveWindow();
}
diff --git a/chrome/browser/chromeos/ash_config.cc b/chrome/browser/chromeos/ash_config.cc
deleted file mode 100644
index 0c18f36f..0000000
--- a/chrome/browser/chromeos/ash_config.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2017 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 "chrome/browser/chromeos/ash_config.h"
-
-#include "ui/base/ui_base_features.h"
-
-namespace chromeos {
-
-namespace {
-
-ash::Config ComputeAshConfig() {
- return base::FeatureList::IsEnabled(features::kMash) ? ash::Config::MASH
- : ash::Config::CLASSIC;
-}
-
-} // namespace
-
-ash::Config GetAshConfig() {
- static const ash::Config config = ComputeAshConfig();
- return config;
-}
-
-} // namespace chromeos
diff --git a/chrome/browser/chromeos/ash_config.h b/chrome/browser/chromeos/ash_config.h
deleted file mode 100644
index e34ac5e..0000000
--- a/chrome/browser/chromeos/ash_config.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2017 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 CHROME_BROWSER_CHROMEOS_ASH_CONFIG_H_
-#define CHROME_BROWSER_CHROMEOS_ASH_CONFIG_H_
-
-#include "ash/public/cpp/config.h"
-
-namespace chromeos {
-
-// Returns the configuration of ash begin run.
-ash::Config GetAshConfig();
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_ASH_CONFIG_H_
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index f34ad68..dcb37d7 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -44,7 +44,6 @@
#include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.h"
#include "chrome/browser/chromeos/arc/arc_service_launcher.h"
#include "chrome/browser/chromeos/arc/voice_interaction/voice_interaction_controller_client.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/boot_times_recorder.h"
#include "chrome/browser/chromeos/dbus/chrome_proxy_resolution_service_provider_delegate.h"
#include "chrome/browser/chromeos/dbus/chrome_virtual_file_request_service_provider_delegate.h"
@@ -317,7 +316,7 @@
DBusThreadManager::Get()->GetSystemBus(),
chromeos::DBusThreadManager::Get()->IsUsingFakes());
- if (GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
// In Mash, power policy is sent to powerd by ash.
PowerPolicyController::Initialize(
DBusThreadManager::Get()->GetPowerManagerClient());
@@ -425,7 +424,7 @@
vm_applications_service_.reset();
drive_file_stream_service_.reset();
PowerDataCollector::Shutdown();
- if (GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
PowerPolicyController::Shutdown();
device::BluetoothAdapterFactory::Shutdown();
bluez::BluezDBusManager::Shutdown();
@@ -742,7 +741,7 @@
AccessibilityManager::Initialize();
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
// Initialize magnification manager before ash tray is created. And this
// must be placed after UserManager::SessionStarted();
// TODO(sad): These components expects the ash::Shell instance to be
@@ -1006,7 +1005,7 @@
spoken_feedback_event_rewriter_delegate_ =
std::make_unique<SpokenFeedbackEventRewriterDelegate>();
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
// TODO(mash): Support EventRewriterController; see crbug.com/647781
ash::EventRewriterController* event_rewriter_controller =
ash::Shell::Get()->event_rewriter_controller();
@@ -1088,7 +1087,7 @@
// Detach D-Bus clients before DBusThreadManager is shut down.
idle_action_warning_observer_.reset();
- if (chromeos::GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
MagnificationManager::Shutdown();
media::SoundsManager::Shutdown();
@@ -1136,7 +1135,7 @@
// ChromeBrowserMainPartsLinux::PostMainMessageLoopRun().
arc_service_launcher_.reset();
- if (chromeos::GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
AccessibilityManager::Shutdown();
input_method::Shutdown();
diff --git a/chrome/browser/chromeos/display/output_protection_delegate.cc b/chrome/browser/chromeos/display/output_protection_delegate.cc
index 7c3d886..0ab519c 100644
--- a/chrome/browser/chromeos/display/output_protection_delegate.cc
+++ b/chrome/browser/chromeos/display/output_protection_delegate.cc
@@ -6,9 +6,9 @@
#include "chrome/browser/chromeos/display/output_protection_controller_ash.h"
#include "chrome/browser/chromeos/display/output_protection_controller_mus.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/display/types/display_constants.h"
@@ -99,7 +99,7 @@
if (!window)
return false;
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
controller_ = std::make_unique<OutputProtectionControllerMus>();
else
controller_ = std::make_unique<OutputProtectionControllerAsh>();
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index 7c1e726..b847d20 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -28,7 +28,6 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/generated_resources.h"
@@ -886,4 +885,4 @@
}
Respond(TwoArguments(image_info.ToValue(),
std::make_unique<Value>(next_resume_token)));
-}
\ No newline at end of file
+}
diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
index 2a4993a..d510305d 100644
--- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
+++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
@@ -12,8 +12,8 @@
#include "ash/wm/window_util.h"
#include "base/logging.h"
#include "chrome/browser/chromeos/input_method/mode_indicator_controller.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "ui/base/ime/ime_bridge.h"
+#include "ui/base/ui_base_features.h"
#include "ui/chromeos/ime/infolist_window.h"
#include "ui/views/widget/widget.h"
@@ -46,7 +46,7 @@
return;
gfx::NativeView parent = nullptr;
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
aura::Window* active_window = ash::wm::GetActiveWindow();
parent = ash::Shell::GetContainer(
active_window ? active_window->GetRootWindow()
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index a334947..2691f04 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -15,7 +15,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/candidate_window.h"
@@ -25,6 +24,7 @@
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/ime_bridge.h"
#include "ui/base/ime/text_input_flags.h"
+#include "ui/base/ui_base_features.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/events/event.h"
@@ -218,7 +218,7 @@
void InputMethodEngine::HideInputView() {
// TODO(mash): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
auto* keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled()) {
keyboard_controller->HideKeyboardByUser();
@@ -232,7 +232,7 @@
->EnableInputView();
// TODO(mash): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
auto* keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled())
keyboard_controller->Reload();
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 24e72124..a04a34d8 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -27,14 +27,12 @@
#include "base/sys_info.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part_chromeos.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/input_method/candidate_window_controller.h"
#include "chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chromeos/system/devicemode.h"
@@ -48,6 +46,7 @@
#include "ui/base/ime/chromeos/ime_keyboard_mus.h"
#include "ui/base/ime/chromeos/input_method_delegate.h"
#include "ui/base/ime/ime_bridge.h"
+#include "ui/base/ui_base_features.h"
#include "ui/chromeos/ime/input_method_menu_item.h"
#include "ui/chromeos/ime/input_method_menu_manager.h"
#include "ui/keyboard/keyboard_controller.h"
@@ -1094,7 +1093,7 @@
// TODO(mash): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
auto* keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled())
keyboard_controller->Reload();
diff --git a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc
index 6adac19f..a5a2ade 100644
--- a/chrome/browser/chromeos/input_method/mode_indicator_controller.cc
+++ b/chrome/browser/chromeos/input_method/mode_indicator_controller.cc
@@ -9,11 +9,11 @@
#include "ash/wm/window_util.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/base/ime/chromeos/input_method_util.h"
+#include "ui/base/ui_base_features.h"
namespace chromeos {
namespace input_method {
@@ -96,7 +96,7 @@
// though it is created by Chrome.
// TODO(crbug.com/738531): Consider moving the ModeIndicatorView into ash.
const int container_id = ash::kShellWindowId_SettingBubbleContainer;
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
using ui::mojom::WindowManager;
params->mus_properties[WindowManager::kContainerId_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(container_id);
diff --git a/chrome/browser/chromeos/login/app_launch_controller.cc b/chrome/browser/chromeos/login/app_launch_controller.cc
index 306878ba..ee49c21 100644
--- a/chrome/browser/chromeos/login/app_launch_controller.cc
+++ b/chrome/browser/chromeos/login/app_launch_controller.cc
@@ -30,7 +30,6 @@
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chromeos/settings/cros_settings_names.h"
@@ -41,6 +40,7 @@
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/common/features/feature_session_type.h"
#include "net/base/network_change_notifier.h"
+#include "ui/base/ui_base_features.h"
#include "ui/keyboard/keyboard_util.h"
namespace chromeos {
@@ -320,7 +320,7 @@
profile_->InitChromeOSPreferences();
// Reset virtual keyboard to use IME engines in app profile early.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
if (keyboard::IsKeyboardEnabled())
ash::Shell::Get()->EnableKeyboard();
} else {
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index 159ebc5..de8dc81 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -40,7 +40,6 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/login_screen_client.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h"
diff --git a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
index ba72dde6..4d1e6532 100644
--- a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
@@ -12,7 +12,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h"
@@ -22,7 +21,6 @@
#include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
@@ -43,6 +41,7 @@
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/keyboard/keyboard_util.h"
@@ -78,7 +77,7 @@
// Bail for mash because IdleDetector/UserActivityDetector does not work
// properly there.
// TODO(xiyuan): Revisit after http://crbug.com/626899.
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return false;
Profile* profile = ProfileHelper::Get()->GetProfileByUser(
@@ -144,7 +143,7 @@
gfx::Rect bounds = display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
lock_time_ = base::TimeTicks::Now();
- lock_window_ = new ash::LockWindow(chromeos::GetAshConfig());
+ lock_window_ = new ash::LockWindow();
lock_window_->AddObserver(this);
Init();
diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc
index 612419c..d3272ccf 100644
--- a/chrome/browser/chromeos/login/login_utils_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc
@@ -4,14 +4,12 @@
#include <string>
-#include "ash/public/cpp/config.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/login/screens/gaia_view.h"
#include "chrome/browser/chromeos/login/test/oobe_base_test.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
@@ -31,6 +29,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_response.h"
#include "rlz/buildflags/buildflags.h"
+#include "ui/base/ui_base_features.h"
#if BUILDFLAG(ENABLE_RLZ)
#include "base/task_scheduler/post_task.h"
@@ -80,7 +79,7 @@
// Exercises login, like the desktopui_MashLogin Chrome OS autotest.
IN_PROC_BROWSER_TEST_F(LoginUtilsTest, MashLogin) {
- if (GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
return;
WaitForSigninScreen();
diff --git a/chrome/browser/chromeos/login/session/chrome_session_manager.cc b/chrome/browser/chromeos/login/session/chrome_session_manager.cc
index 364457c..aa315f8eb 100644
--- a/chrome/browser/chromeos/login/session/chrome_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/chrome_session_manager.cc
@@ -31,7 +31,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/app_list/app_list_client_impl.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
diff --git a/chrome/browser/chromeos/login/ui/input_events_blocker.cc b/chrome/browser/chromeos/login/ui/input_events_blocker.cc
index aeba656..9f1e46e 100644
--- a/chrome/browser/chromeos/login/ui/input_events_blocker.cc
+++ b/chrome/browser/chromeos/login/ui/input_events_blocker.cc
@@ -6,7 +6,7 @@
#include "ash/shell.h"
#include "base/logging.h"
-#include "chrome/browser/ui/ash/ash_util.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/event.h"
namespace chromeos {
@@ -14,7 +14,7 @@
InputEventsBlocker::InputEventsBlocker() {
// TODO(mash): Implement a mash version. This will probably need to talk to
// the window server.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
ash::Shell::Get()->AddPreTargetHandler(this,
ui::EventTarget::Priority::kSystem);
VLOG(1) << "InputEventsBlocker " << this << " created.";
@@ -24,7 +24,7 @@
}
InputEventsBlocker::~InputEventsBlocker() {
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
ash::Shell::Get()->RemovePreTargetHandler(this);
VLOG(1) << "InputEventsBlocker " << this << " destroyed.";
} else {
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_common.cc b/chrome/browser/chromeos/login/ui/login_display_host_common.cc
index c57a508..7dc0b94 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_common.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_common.cc
@@ -15,11 +15,11 @@
#include "chrome/browser/chromeos/mobile_config.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/system/device_disabling_manager.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
+#include "ui/base/ui_base_features.h"
#include "ui/wm/public/scoped_drag_drop_disabler.h"
namespace chromeos {
@@ -49,7 +49,7 @@
// Disable Drag'n'Drop for the login session.
// ash::Shell may be null in tests.
- if (ash::Shell::HasInstance() && !ash_util::IsRunningInMash()) {
+ if (ash::Shell::HasInstance() && features::IsAshInBrowserProcess()) {
scoped_drag_drop_disabler_.reset(
new wm::ScopedDragDropDisabler(ash::Shell::GetPrimaryRootWindow()));
} else {
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc
index b1fcb2a3..8811fea 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc
@@ -55,7 +55,6 @@
#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/common/chrome_constants.h"
@@ -90,6 +89,7 @@
#include "ui/base/ime/chromeos/input_method_manager.h"
#include "ui/base/ime/chromeos/input_method_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_features.h"
#include "ui/compositor/compositor_observer.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
@@ -397,7 +397,7 @@
// * Ash crash at the login screen on mustash
// In the latter case the mash root process will trigger a clean restart
// of content_browser.
- if (ash_util::IsRunningInMash() && login_display_host_)
+ if (!features::IsAshInBrowserProcess() && login_display_host_)
login_display_host_->ResetLoginWindowAndView();
}
void DeleteDelegate() override { delete this; }
@@ -420,7 +420,7 @@
LoginDisplayHostWebUI::LoginDisplayHostWebUI()
: oobe_startup_sound_played_(StartupUtils::IsOobeCompleted()),
weak_factory_(this) {
- if (ash_util::IsRunningInMash()) {
+ if (!features::IsAshInBrowserProcess()) {
// Animation, and initializing hidden, are not currently supported for Mash.
finalize_animation_type_ = ANIMATION_NONE;
initialize_webui_hidden_ = false;
@@ -439,19 +439,19 @@
bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
// Mash always runs login screen with zero delay
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
zero_delay_enabled = true;
waiting_for_wallpaper_load_ = !zero_delay_enabled;
// Initializing hidden is not supported in Mash
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
initialize_webui_hidden_ =
kHiddenWebUIInitializationDefault && !zero_delay_enabled;
}
// Check if WebUI init type is overriden. Not supported in Mash.
- if (!ash_util::IsRunningInMash() &&
+ if (features::IsAshInBrowserProcess() &&
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshWebUIInit)) {
const std::string override_type =
@@ -621,7 +621,7 @@
restore_path_ = RESTORE_ADD_USER_INTO_SESSION;
// Animation is not supported in Mash
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
finalize_animation_type_ = ANIMATION_ADD_USER;
// Observe the user switch animation and defer the deletion of itself only
// after the animation is finished.
@@ -637,7 +637,7 @@
// We should emit this signal only at login screen (after reboot or sign out).
login_view_->set_should_emit_login_prompt_visible(false);
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
// Lock container can be transparent after lock screen animation.
aura::Window* lock_container = ash::Shell::GetContainer(
ash::Shell::GetPrimaryRootWindow(),
@@ -679,7 +679,7 @@
restore_path_ = RESTORE_SIGN_IN;
is_showing_login_ = true;
// Animation is not supported in Mash
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
finalize_animation_type_ = ANIMATION_WORKSPACE;
if (waiting_for_wallpaper_load_ && !initialize_webui_hidden_) {
@@ -730,7 +730,7 @@
void LoginDisplayHostWebUI::OnStartAppLaunch() {
// Animation is not supported in Mash.
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
finalize_animation_type_ = ANIMATION_FADE_OUT;
if (!login_window_)
LoadURL(GURL(kAppLaunchSplashURL));
@@ -740,7 +740,7 @@
void LoginDisplayHostWebUI::OnStartArcKiosk() {
// Animation is not supported in Mash.
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
finalize_animation_type_ = ANIMATION_FADE_OUT;
if (!login_window_) {
LoadURL(GURL(kAppLaunchSplashURL));
@@ -918,7 +918,7 @@
// LoginDisplayHostWebUI, private
void LoginDisplayHostWebUI::ScheduleWorkspaceAnimation() {
- if (ash_util::IsRunningInMash()) {
+ if (!features::IsAshInBrowserProcess()) {
NOTIMPLEMENTED();
return;
}
@@ -1029,7 +1029,7 @@
? ash::kShellWindowId_AlwaysOnTopContainer
: ash::kShellWindowId_LockScreenContainer;
// The ash::Shell containers are not available in Mash
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
params.parent =
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), container);
} else {
@@ -1049,7 +1049,7 @@
// Animations are not available in Mash.
// For voice interaction OOBE, we do not want the animation here.
- if (!ash_util::IsRunningInMash() && !is_voice_interaction_oobe_) {
+ if (features::IsAshInBrowserProcess() && !is_voice_interaction_oobe_) {
login_window_->SetVisibilityAnimationDuration(
base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
login_window_->SetVisibilityAnimationTransition(
@@ -1082,7 +1082,7 @@
}
if (login_window_) {
- if (ash_util::IsRunningInMash()) {
+ if (!features::IsAshInBrowserProcess()) {
login_window_->Close();
} else {
login_window_->Hide();
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc
index eb0a259..1aa5824 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -38,7 +38,6 @@
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/sessions/session_tab_helper.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
@@ -61,6 +60,7 @@
#include "content/public/common/renderer_preferences.h"
#include "extensions/browser/view_type_utils.h"
#include "third_party/blink/public/platform/web_input_event.h"
+#include "ui/base/ui_base_features.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/keyboard/keyboard_controller.h"
@@ -126,7 +126,7 @@
: settings_(settings) {
// TODO(mash): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
keyboard::KeyboardController::Get()->AddObserver(this);
} else {
NOTIMPLEMENTED();
@@ -191,7 +191,7 @@
kAccelSendFeedback;
for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) {
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
// To make reset accelerator work while system tray is open, register it
// at accelerator controller.
ash::Shell::Get()->accelerator_controller()->Register({i->first}, this);
@@ -203,7 +203,7 @@
}
}
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
ash::Shell::Get()->system_tray_notifier()->AddSystemTrayFocusObserver(this);
}
@@ -211,7 +211,7 @@
for (auto& observer : observer_list_)
observer.OnHostDestroying();
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
ash::Shell::Get()->system_tray_notifier()->RemoveSystemTrayFocusObserver(
this);
ash::Shell::Get()->accelerator_controller()->UnregisterAll(this);
@@ -353,7 +353,7 @@
web_view()->RequestFocus();
// There is no Shell instance while running in mash.
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return;
}
@@ -581,7 +581,7 @@
bool WebUILoginView::MoveFocusToSystemTray(bool reverse) {
// Focus is accepted, but the Ash system tray is not available in Mash, so
// exit early.
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return true;
// The old system tray is not available when UnifiedSystemTray is enabled.
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index b07a3fd..2ba9c9c 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -74,7 +74,6 @@
#include "chrome/browser/metrics/metrics_reporting_state.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/tablet_mode_client.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
@@ -111,6 +110,7 @@
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/accelerators/accelerator.h"
+#include "ui/base/ui_base_features.h"
using content::BrowserThread;
@@ -275,7 +275,7 @@
// In session OOBE was initiated from voice interaction keyboard shortcuts.
is_in_session_oobe_ =
session_manager::SessionManager::Get()->IsSessionStarted();
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
if (accessibility_manager) {
// accessibility_manager could be null in Tests.
diff --git a/chrome/browser/chromeos/power/ml/adaptive_screen_brightness_manager.cc b/chrome/browser/chromeos/power/ml/adaptive_screen_brightness_manager.cc
index d1a387f..0974293 100644
--- a/chrome/browser/chromeos/power/ml/adaptive_screen_brightness_manager.cc
+++ b/chrome/browser/chromeos/power/ml/adaptive_screen_brightness_manager.cc
@@ -16,7 +16,6 @@
#include "base/timer/timer.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/power/ml/adaptive_screen_brightness_ukm_logger.h"
#include "chrome/browser/chromeos/power/ml/adaptive_screen_brightness_ukm_logger_impl.h"
#include "chrome/browser/chromeos/power/ml/real_boot_clock.h"
@@ -37,6 +36,7 @@
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/viz/public/interfaces/compositing/video_detector_observer.mojom.h"
#include "ui/aura/env.h"
+#include "ui/base/ui_base_features.h"
#include "ui/base/user_activity/user_activity_detector.h"
namespace chromeos {
@@ -162,7 +162,7 @@
// TODO(jiameng): video detector below doesn't work with MASH. Temporary
// solution is to disable logging if we're under MASH env.
if (chromeos::GetDeviceType() != chromeos::DeviceType::kChromebook ||
- chromeos::GetAshConfig() == ash::Config::MASH) {
+ !features::IsAshInBrowserProcess()) {
return nullptr;
}
diff --git a/chrome/browser/chromeos/power/ml/user_activity_controller.cc b/chrome/browser/chromeos/power/ml/user_activity_controller.cc
index f99c4df..d564e114 100644
--- a/chrome/browser/chromeos/power/ml/user_activity_controller.cc
+++ b/chrome/browser/chromeos/power/ml/user_activity_controller.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/chromeos/power/ml/user_activity_controller.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/system/devicetype.h"
@@ -12,6 +11,7 @@
#include "components/viz/host/host_frame_sink_manager.h"
#include "services/viz/public/interfaces/compositing/video_detector_observer.mojom.h"
#include "ui/aura/env.h"
+#include "ui/base/ui_base_features.h"
#include "ui/compositor/compositor.h"
namespace chromeos {
@@ -22,7 +22,7 @@
// TODO(jiameng): video detector below doesn't work with MASH. Temporary
// solution is to disable logging if we're under MASH env.
if (chromeos::GetDeviceType() != chromeos::DeviceType::kChromebook ||
- chromeos::GetAshConfig() == ash::Config::MASH)
+ !features::IsAshInBrowserProcess())
return;
chromeos::PowerManagerClient* power_manager_client =
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index b8c4e3e..86447d9 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/input_method/input_method_syncer.h"
#include "chrome/browser/chromeos/login/session/user_session_manager.h"
@@ -32,7 +31,6 @@
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/ui/ash/ash_shell_init.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/chromeos/system_logs/touch_log_source.cc b/chrome/browser/chromeos/system_logs/touch_log_source.cc
index 6bb16805..e47ed38 100644
--- a/chrome/browser/chromeos/system_logs/touch_log_source.cc
+++ b/chrome/browser/chromeos/system_logs/touch_log_source.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "ash/public/cpp/config.h"
#include "ash/touch/touch_hud_debug.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -20,9 +19,9 @@
#include "base/task_scheduler/post_task.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part_chromeos.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "content/public/browser/browser_thread.h"
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
+#include "ui/base/ui_base_features.h"
using content::BrowserThread;
@@ -171,7 +170,7 @@
// Collect touch HUD debug logs. This needs to be done on the UI thread.
void CollectTouchHudDebugLog(system_logs::SystemLogsResponse* response) {
// TODO(mash): Collect this data from window server over mojo.
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
NOTIMPLEMENTED();
return;
}
diff --git a/chrome/browser/exo_parts.cc b/chrome/browser/exo_parts.cc
index e7edc34..3355eca 100644
--- a/chrome/browser/exo_parts.cc
+++ b/chrome/browser/exo_parts.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
#include "chrome/browser/chromeos/file_manager/path_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/common/chrome_switches.h"
#include "components/exo/file_helper.h"
#include "components/user_manager/user_manager.h"
@@ -23,6 +22,7 @@
#include "content/public/common/drop_data.h"
#include "storage/browser/fileapi/file_system_context.h"
#include "storage/browser/fileapi/file_system_url.h"
+#include "ui/base/ui_base_features.h"
namespace {
@@ -106,7 +106,7 @@
// static
std::unique_ptr<ExoParts> ExoParts::CreateIfNecessary() {
// For mash, exosphere will not run in the browser process.
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return nullptr;
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kAshEnableWaylandServer)) {
@@ -121,7 +121,7 @@
}
ExoParts::ExoParts() {
- DCHECK(!ash_util::IsRunningInMash());
+ DCHECK(features::IsAshInBrowserProcess());
std::unique_ptr<ChromeFileHelper> file_helper =
std::make_unique<ChromeFileHelper>();
ash::Shell::Get()->InitWaylandServer(std::move(file_helper));
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 10354f1..d04a2ce 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -98,17 +98,16 @@
#include "ui/base/ui_base_types.h"
#if defined(OS_CHROMEOS)
-#include "ash/public/cpp/config.h"
#include "ash/public/cpp/window_pin_type.h"
#include "ash/public/cpp/window_properties.h"
#include "ash/public/interfaces/window_pin_type.mojom.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
#include "chrome/browser/ui/browser_command_controller.h"
#include "content/public/browser/devtools_agent_host.h"
#include "ui/aura/window.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/clipboard_types.h"
+#include "ui/base/ui_base_features.h"
#endif
using content::BrowserThread;
@@ -282,7 +281,7 @@
// Disallow screenshots in locked fullscreen mode.
// TODO(isandrk, 816900): ChromeScreenshotGrabber isn't implemented in Mash
// yet, remove this conditional when it becomes available.
- if (chromeos::GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
ChromeScreenshotGrabber::Get()->set_screenshots_allowed(!locked);
// Reset the clipboard and kill dev tools when entering or exiting locked
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
index f68368e7..91bd4c2a 100644
--- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
+++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
@@ -33,7 +33,6 @@
#include "ash/public/interfaces/constants.mojom.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/metrics/chromeos_metrics_provider.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chromeos/system/statistics_provider.h"
#include "chromeos/system/version_loader.h"
#include "content/public/common/service_manager_connection.h"
diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
index e7614c1..899befd 100644
--- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -39,7 +39,7 @@
#if defined(OS_CHROMEOS)
#include "ash/shell.h"
-#include "chrome/browser/chromeos/ash_config.h"
+#include "ui/base/ui_base_features.h"
#endif // defined(OS_CHROMEOS)
using content::BrowserThread;
@@ -272,7 +272,7 @@
content::MEDIA_DEVICE_INVALID_STATE;
#if defined(OS_CHROMEOS)
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
// TODO(crbug.com/806366): Screen capture support for mash.
NOTIMPLEMENTED() << "Screen capture not yet implemented in --mash";
screen_capture_enabled = false;
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
index d9d2292..78a53c4 100644
--- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
@@ -4,7 +4,6 @@
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
-#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/download/download_prefs.h"
@@ -2327,7 +2326,6 @@
IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest,
AppendRecentNavigationsToEmptyReferrerChain) {
- base::test::ScopedFeatureList scoped_feature_list;
ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(kSingleFrameTestURL));
GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL);
diff --git a/chrome/browser/ui/app_list/chrome_app_list_model_updater.cc b/chrome/browser/ui/app_list/chrome_app_list_model_updater.cc
index a517e08..c2cb98d 100644
--- a/chrome/browser/ui/app_list/chrome_app_list_model_updater.cc
+++ b/chrome/browser/ui/app_list/chrome_app_list_model_updater.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/chrome_app_list_item.h"
#include "chrome/browser/ui/app_list/search/chrome_search_result.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "extensions/common/constants.h"
#include "ui/base/models/menu_model.h"
diff --git a/chrome/browser/ui/ash/ash_shell_init.h b/chrome/browser/ui/ash/ash_shell_init.h
index 08187a3..ef4936e 100644
--- a/chrome/browser/ui/ash/ash_shell_init.h
+++ b/chrome/browser/ui/ash/ash_shell_init.h
@@ -9,7 +9,7 @@
class PrefRegistrySimple;
-// Initializes and destroys the ash::Shell for ash::Config::CLASSIC.
+// Initializes and destroys the ash::Shell when Ash is running in process.
class AshShellInit {
public:
AshShellInit();
diff --git a/chrome/browser/ui/ash/ash_util.cc b/chrome/browser/ui/ash/ash_util.cc
index 5b6bf89..b1ad20d 100644
--- a/chrome/browser/ui/ash/ash_util.cc
+++ b/chrome/browser/ui/ash/ash_util.cc
@@ -10,27 +10,23 @@
#include "ash/public/interfaces/event_properties.mojom.h"
#include "ash/shell.h"
#include "base/macros.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "ui/aura/window_event_dispatcher.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
namespace ash_util {
bool ShouldOpenAshOnStartup() {
- return !IsRunningInMash();
-}
-
-bool IsRunningInMash() {
- return chromeos::GetAshConfig() == ash::Config::MASH;
+ return features::IsAshInBrowserProcess();
}
bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) {
// When running in mash the browser doesn't handle ash accelerators.
- if (IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return false;
return ash::Shell::Get()->accelerator_controller()->IsDeprecated(accelerator);
@@ -47,7 +43,7 @@
DCHECK_GE(container_id, ash::kShellWindowId_MinContainer);
DCHECK_LE(container_id, ash::kShellWindowId_MaxContainer);
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
using ui::mojom::WindowManager;
params->mus_properties[WindowManager::kContainerId_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(container_id);
diff --git a/chrome/browser/ui/ash/ash_util.h b/chrome/browser/ui/ash/ash_util.h
index c6eeed5..7ca78c8 100644
--- a/chrome/browser/ui/ash/ash_util.h
+++ b/chrome/browser/ui/ash/ash_util.h
@@ -7,7 +7,6 @@
#include <memory>
-#include "ash/public/cpp/config.h"
#include "ui/views/widget/widget.h"
namespace ui {
@@ -20,10 +19,6 @@
// Returns true if Ash should be run at startup.
bool ShouldOpenAshOnStartup();
-// Returns true if Chrome is running in the mash shell.
-// TODO(sky): convert to chromeos::GetAshConfig() and remove.
-bool IsRunningInMash();
-
// Returns true if the given |accelerator| has been deprecated and hence can
// be consumed by web contents if needed.
bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator);
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
index 517f3eb..099b1ef 100644
--- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
+++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -16,7 +16,6 @@
#include "base/command_line.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/night_light/night_light_client.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -64,6 +63,7 @@
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/user_activity_forwarder.h"
#include "ui/base/ime/chromeos/input_method_manager.h"
+#include "ui/base/ui_base_features.h"
#include "ui/base/user_activity/user_activity_detector.h"
#include "ui/views/mus/mus_client.h"
@@ -141,7 +141,7 @@
void ChromeBrowserMainExtraPartsAsh::ServiceManagerConnectionStarted(
content::ServiceManagerConnection* connection) {
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
// ash::Shell will not be created because ash is running out-of-process.
ash::Shell::SetIsBrowserProcessWithMash();
DCHECK(views::MusClient::Exists());
@@ -164,7 +164,7 @@
std::make_unique<NetworkConnectDelegateChromeOS>();
chromeos::NetworkConnect::Initialize(network_connect_delegate_.get());
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
ash_shell_init_ = std::make_unique<AshShellInit>();
} else {
immersive_context_ = std::make_unique<ImmersiveContextMus>();
@@ -232,7 +232,7 @@
}
void ChromeBrowserMainExtraPartsAsh::PostProfileInit() {
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
chrome_shell_content_state_ = std::make_unique<ChromeShellContentState>();
cast_config_client_media_router_ =
@@ -253,7 +253,7 @@
}
// TODO(mash): Port TabScrubber.
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
// Initialize TabScrubber after the Ash Shell has been initialized.
TabScrubber::GetInstance();
}
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 0243dca..94f958a 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/browser_process_platform_part_chromeos.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/policy/display_rotation_default_handler.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -39,6 +38,7 @@
#include "content/public/common/url_constants.h"
#include "services/ui/public/cpp/input_devices/input_device_controller_client.h"
#include "ui/aura/window.h"
+#include "ui/base/ui_base_features.h"
#include "url/url_constants.h"
using chromeos::AccessibilityManager;
@@ -104,7 +104,7 @@
void ChromeShellDelegate::PreInit() {
// TODO: port to mash. http://crbug.com/678949.
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return;
// Object owns itself and deletes itself in OnWindowTreeHostManagerShutdown().
diff --git a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
index 1033a1d8..545fd12 100644
--- a/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
+++ b/chrome/browser/ui/ash/launcher/browser_status_monitor.cc
@@ -8,7 +8,6 @@
#include "ash/public/cpp/shelf_types.h"
#include "base/macros.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_util.h"
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
index 959e7dc..efa648da 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -21,7 +21,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/extensions/chrome_app_icon_loader.h"
#include "chrome/browser/extensions/extension_util.h"
@@ -35,7 +34,6 @@
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/app_list/crostini/crostini_app_icon_loader.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_icon_loader.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
#include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h"
#include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h"
@@ -79,6 +77,7 @@
#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/types/display_constants.h"
#include "ui/keyboard/keyboard_util.h"
#include "ui/resources/grit/ui_resources.h"
@@ -554,7 +553,7 @@
// user.
RestoreUnpinnedRunningApplicationOrder(user_email);
// TODO(crbug.com/557406): Fix this interaction pattern in Mash.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
// Force on-screen keyboard to reset.
if (keyboard::IsKeyboardEnabled())
ash::Shell::Get()->EnableKeyboard();
@@ -1005,7 +1004,7 @@
: keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED);
}
// TODO(crbug.com/557406): Fix this interaction pattern in Mash.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
const bool is_enabled = keyboard::IsKeyboardEnabled();
if (was_enabled && !is_enabled)
ash::Shell::Get()->DisableKeyboard();
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index ecb98c6..3adfc3b3 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -39,7 +39,6 @@
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
index 853b60f7..0c840429 100644
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc
@@ -11,7 +11,6 @@
#include "ash/public/cpp/window_properties.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.h"
diff --git a/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.cc
index b9fd53ee..36bfc12 100644
--- a/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/extension_launcher_context_menu.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/extensions/context_menu_matcher.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/launch_util.h"
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
index 3813a026..0818662 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
@@ -5,13 +5,13 @@
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
#include "base/logging.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_stub.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
#include "components/account_id/account_id.h"
#include "components/user_manager/user_info.h"
#include "components/user_manager/user_manager.h"
+#include "ui/base/ui_base_features.h"
namespace {
MultiUserWindowManager* g_multi_user_window_manager_instance = nullptr;
@@ -26,7 +26,7 @@
DCHECK(!g_multi_user_window_manager_instance);
// TODO(crbug.com/557406): Enable this component in Mash. The object itself
// has direct ash dependencies.
- if (!ash_util::IsRunningInMash() &&
+ if (features::IsAshInBrowserProcess() &&
SessionControllerClient::IsMultiProfileAvailable()) {
MultiUserWindowManagerChromeOS* manager =
new MultiUserWindowManagerChromeOS(
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
index 609af07..6a5a1d7e 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
@@ -17,7 +17,6 @@
#include "base/strings/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/media_client.h"
@@ -37,6 +36,7 @@
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_types.h"
#include "ui/events/event.h"
#include "ui/wm/core/transient_window_manager.h"
@@ -719,7 +719,7 @@
if (visible) {
// TODO(erg): When we get rid of the classic ash, get rid of the direct
// linkage on tablet_mode_controller() here.
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
aura::WindowTreeHostMus::ForWindow(window)->PerformWmAction(
ash::mojom::kAddWindowToTabletMode);
} else {
diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client.cc
index cd8b458..4ac868e 100644
--- a/chrome/browser/ui/ash/system_tray_client.cc
+++ b/chrome/browser/ui/ash/system_tray_client.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/lifetime/termination_notification.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/singleton_tabs.h"
@@ -57,6 +56,7 @@
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/event_constants.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
@@ -177,7 +177,7 @@
// Place the dialog in the appropriate modal dialog container, either above
// or below the lock screen, based on the login state.
int container_id = GetDialogParentContainerId();
- if (ash_util::IsRunningInMash()) {
+ if (!features::IsAshInBrowserProcess()) {
using ui::mojom::WindowManager;
params.mus_properties[WindowManager::kContainerId_InitProperty] =
mojo::ConvertTo<std::vector<uint8_t>>(container_id);
diff --git a/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc b/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
index a68dd584..c91dbc4a 100644
--- a/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
+++ b/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
@@ -6,11 +6,9 @@
#include <stddef.h>
-#include "ash/public/cpp/config.h"
#include "base/memory/singleton.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/extensions/api/automation_internal/automation_event_router.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profiles_state.h"
@@ -34,6 +32,7 @@
#include "ash/shell.h" // nogncheck
#include "ash/wm/window_util.h" // nogncheck
#include "components/session_manager/core/session_manager.h"
+#include "ui/base/ui_base_features.h"
#endif
using content::BrowserContext;
@@ -89,7 +88,7 @@
views::AXAuraObjCache::GetInstance()->SetDelegate(this);
#if defined(OS_CHROMEOS)
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
aura::Window* active_window = ash::wm::GetActiveWindow();
if (active_window) {
views::AXAuraObjWrapper* focus =
diff --git a/chrome/browser/ui/test/test_browser_dialog.cc b/chrome/browser/ui/test/test_browser_dialog.cc
index 83e93f3..9cc73d48 100644
--- a/chrome/browser/ui/test/test_browser_dialog.cc
+++ b/chrome/browser/ui/test/test_browser_dialog.cc
@@ -12,9 +12,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_CHROMEOS)
-#include "ash/public/cpp/config.h"
#include "ash/shell.h" // mash-ok
-#include "chrome/browser/chromeos/ash_config.h"
+#include "ui/base/ui_base_features.h"
#endif
#if defined(OS_MACOSX)
@@ -137,7 +136,7 @@
// Under mash, GetAllWidgets() uses MusClient to get the list of root windows.
// Otherwise, GetAllWidgets() relies on AuraTestHelper to get the root window,
// but that is not available in browser_tests, so use ash::Shell directly.
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
widgets_ = views::test::WidgetTest::GetAllWidgets();
} else {
for (aura::Window* root_window : ash::Shell::GetAllRootWindows())
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
index 1996756..09e4dc1 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
@@ -22,7 +22,6 @@
#include "ash/wm/window_state_delegate.h"
#include "ash/wm/window_state_observer.h"
#include "base/logging.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/note_taking_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h"
@@ -40,6 +39,7 @@
#include "ui/aura/window_observer.h"
#include "ui/base/hit_test.h"
#include "ui/base/models/simple_menu_model.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/skia_util.h"
@@ -198,8 +198,7 @@
views::Widget* widget) {
ChromeNativeAppWindowViewsAura::OnBeforePanelWidgetInit(init_params, widget);
- if (chromeos::GetAshConfig() != ash::Config::MASH &&
- ash::Shell::HasInstance()) {
+ if (features::IsAshInBrowserProcess() && ash::Shell::HasInstance()) {
// Open a new panel on the target root.
init_params->context = ash::Shell::GetRootWindowForNewWindows();
init_params->bounds = gfx::Rect(GetPreferredSize());
@@ -230,7 +229,7 @@
if (IsFrameless())
return true;
- return HasFrameColor() && chromeos::GetAshConfig() != ash::Config::MASH;
+ return HasFrameColor() && features::IsAshInBrowserProcess();
}
///////////////////////////////////////////////////////////////////////////////
@@ -329,7 +328,7 @@
if (IsFrameless())
return CreateNonStandardAppFrame();
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return nullptr;
if (app_window()->window_type_is_panel()) {
@@ -399,7 +398,7 @@
SkRegion* draggable_region = GetDraggableRegion();
// Set the NativeAppWindow's draggable region on the mus window.
if (draggable_region && !draggable_region->isEmpty() && widget() &&
- chromeos::GetAshConfig() == ash::Config::MASH) {
+ !features::IsAshInBrowserProcess()) {
// Supply client area insets that encompass all draggable regions.
gfx::Insets insets(draggable_region->getBounds().bottom(), 0, 0, 0);
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
index d7d63e8..b23e26b4 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -51,8 +51,8 @@
#if defined(OS_CHROMEOS)
#include "ash/public/interfaces/constants.mojom.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "content/public/common/content_switches.h"
+#include "ui/base/ui_base_features.h"
#else // defined(OS_CHROMEOS)
#include "chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller.h"
#endif // defined(OS_CHROMEOS)
@@ -156,7 +156,7 @@
#if defined(OS_CHROMEOS)
// Start up the window service and the ash system UI service.
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
connection->GetConnector()->StartService(
service_manager::Identity(ui::mojom::kServiceName));
connection->GetConnector()->StartService(
@@ -165,7 +165,7 @@
#endif
#if defined(OS_CHROMEOS)
- if (chromeos::GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
return;
#endif
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
index 63df04f..434a1f0 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
@@ -55,7 +55,8 @@
std::unique_ptr<wm::WMState> wm_state_;
- // Only used when running in ash::Config::MASH.
+ // Only used when Ash is running out of process.
+ // TODO: make ash specific.
std::unique_ptr<views::MusClient> mus_client_;
#endif
diff --git a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
index 90b70f6..0e82680 100644
--- a/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate_chromeos.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/ui/ash/ash_util.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
@@ -29,7 +29,7 @@
DCHECK(base::MessageLoopForUI::IsCurrent());
// Early return because mash chrome does not have access to ash::Shell
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN;
ash::AcceleratorController* accelerator_controller =
@@ -81,7 +81,7 @@
// Classic ash requires a parent or a context that it can use to look up a
// root window to find a WindowParentingClient. Mash handles window parenting
// inside ash, see ash::CreateAndParentTopLevelWindow().
- if (!ash_util::IsRunningInMash() && !params->parent && !params->context)
+ if (features::IsAshInBrowserProcess() && !params->parent && !params->context)
params->context = ash::Shell::GetRootWindowForNewWindows();
// By returning null Widget creates the default NativeWidget implementation,
diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.cc b/chrome/browser/ui/views/frame/browser_frame_ash.cc
index 4c31792..f55099b 100644
--- a/chrome/browser/ui/views/frame/browser_frame_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_ash.cc
@@ -7,8 +7,8 @@
#include <memory>
// This file is only instantiated in classic ash/mus. It is never used in mash.
-// See native_browser_frame_factory_chromeos.cc switches on GetAshConfig().
-#include "ash/public/cpp/config.h"
+// See native_browser_frame_factory_chromeos.cc switches on
+// features::IsAshInBrowserProcess().
#include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/window_state_type.h"
#include "ash/shell.h" // mash-ok
@@ -18,13 +18,13 @@
#include "ash/wm/window_util.h" // mash-ok
#include "base/macros.h"
#include "build/build_config.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
+#include "ui/base/ui_base_features.h"
#include "ui/views/view.h"
namespace {
@@ -63,7 +63,7 @@
BrowserView* browser_view)
: views::NativeWidgetAura(browser_frame),
browser_view_(browser_view) {
- DCHECK_NE(chromeos::GetAshConfig(), ash::Config::MASH);
+ DCHECK(features::IsAshInBrowserProcess());
GetNativeWindow()->SetName("BrowserFrameAsh");
Browser* browser = browser_view->browser();
ash::wm::WindowState* window_state =
diff --git a/chrome/browser/ui/views/frame/browser_frame_ash_browsertest.cc b/chrome/browser/ui/views/frame/browser_frame_ash_browsertest.cc
index cfc1d94..a7cc5d9 100644
--- a/chrome/browser/ui/views/frame/browser_frame_ash_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_ash_browsertest.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/views/frame/browser_frame_ash.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/views/widget/widget.h"
@@ -83,7 +83,7 @@
Browser* browser = new Browser(params);
browser->window()->Show();
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
WidgetBoundsWatcher watch(
BrowserView::GetBrowserViewForBrowser(browser)->GetWidget(),
original_bounds);
@@ -114,7 +114,7 @@
expectation.set_y(original_bounds.y());
}
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
WidgetBoundsWatcher watch(
BrowserView::GetBrowserViewForBrowser(browser)->GetWidget(),
expectation);
diff --git a/chrome/browser/ui/views/frame/browser_frame_mash.cc b/chrome/browser/ui/views/frame/browser_frame_mash.cc
index 2dcb1ed..c3edd520 100644
--- a/chrome/browser/ui/views/frame/browser_frame_mash.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_mash.cc
@@ -8,13 +8,11 @@
#include <memory>
-#include "ash/public/cpp/config.h"
#include "ash/public/cpp/shelf_types.h"
#include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/window_state_type.h"
#include "ash/public/interfaces/window_properties.mojom.h"
#include "ash/public/interfaces/window_style.mojom.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/browser_window_state.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_frame_ash.h"
@@ -25,6 +23,7 @@
#include "services/ui/public/interfaces/window_tree.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/mus/window_tree_host_mus_init_params.h"
+#include "ui/base/ui_base_features.h"
#include "ui/views/mus/desktop_window_tree_host_mus.h"
#include "ui/views/mus/mus_client.h"
#include "ui/views/mus/window_manager_frame_values.h"
@@ -36,7 +35,7 @@
browser_view_(browser_view) {
DCHECK(browser_frame_);
DCHECK(browser_view_);
- DCHECK_EQ(chromeos::GetAshConfig(), ash::Config::MASH);
+ DCHECK(!features::IsAshInBrowserProcess());
}
BrowserFrameMash::~BrowserFrameMash() {}
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_chromeos.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_chromeos.cc
index 9e0a2ac..a04eca7 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_chromeos.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_chromeos.cc
@@ -2,19 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/public/cpp/config.h"
#include "build/build_config.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mash.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "ui/base/ui_base_features.h"
namespace chrome {
BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
BrowserFrame* frame,
BrowserView* browser_view) {
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
BrowserNonClientFrameViewMash* frame_view =
new BrowserNonClientFrameViewMash(frame, browser_view);
frame_view->Init();
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
index 49e27817..6503545f 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
@@ -9,7 +9,6 @@
#include "ash/public/interfaces/window_state_type.mojom.h"
#include "base/macros.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/tablet_mode_client.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
@@ -25,6 +24,7 @@
#include "ui/aura/mus/property_converter.h"
#include "ui/aura/mus/window_port_mus.h"
#include "ui/aura/window.h"
+#include "ui/base/ui_base_features.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/paint_context.h"
#include "ui/compositor/paint_recorder.h"
@@ -159,7 +159,7 @@
bool ImmersiveModeControllerAsh::ShouldStayImmersiveAfterExitingFullscreen() {
// TODO(crbug.com/760811): Support tablet mode in mash.
- if (ash_util::IsRunningInMash())
+ if (!features::IsAshInBrowserProcess())
return false;
return !browser_view_->IsBrowserTypeNormal() &&
@@ -177,7 +177,7 @@
return;
// TODO(crbug.com/760811): Support tablet mode in mash.
- if (ash_util::IsRunningInMash() ||
+ if (!features::IsAshInBrowserProcess() ||
!TabletModeClient::Get()->tablet_mode_enabled()) {
return;
}
@@ -197,7 +197,7 @@
observers_enabled_ = enable;
aura::Window* native_window = browser_view_->GetNativeWindow();
- aura::Window* target_window = ash_util::IsRunningInMash()
+ aura::Window* target_window = !features::IsAshInBrowserProcess()
? native_window->GetRootWindow()
: native_window;
@@ -223,7 +223,7 @@
}
void ImmersiveModeControllerAsh::CreateMashRevealWidget() {
- if (!ash_util::IsRunningInMash())
+ if (features::IsAshInBrowserProcess())
return;
DCHECK(!mash_reveal_widget_);
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
index 045bb7a..34a1fad 100644
--- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
+++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_browsertest.cc
@@ -12,7 +12,6 @@
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "base/macros.h"
#include "base/test/test_mock_time_task_runner.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
@@ -33,6 +32,7 @@
#include "content/public/common/content_switches.h"
#include "net/cert/mock_cert_verifier.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/base/ui_base_features.h"
#include "ui/views/animation/test/ink_drop_host_view_test_api.h"
class ImmersiveModeControllerAshHostedAppBrowserTest
@@ -271,7 +271,7 @@
LaunchAppBrowser();
ASSERT_FALSE(controller()->IsEnabled());
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
- DCHECK_NE(ash::Config::MASH, chromeos::GetAshConfig());
+ ASSERT_TRUE(features::IsAshInBrowserProcess());
BrowserNonClientFrameViewAsh* frame_view =
static_cast<BrowserNonClientFrameViewAsh*>(
browser_view->GetWidget()->non_client_view()->frame_view());
@@ -327,7 +327,7 @@
LaunchAppBrowser(false);
BrowserView* browser_view =
BrowserView::GetBrowserViewForBrowser(browser());
- DCHECK_NE(ash::Config::MASH, chromeos::GetAshConfig());
+ ASSERT_TRUE(features::IsAshInBrowserProcess());
frame_view = static_cast<BrowserNonClientFrameViewAsh*>(
browser_view->GetWidget()->non_client_view()->frame_view());
diff --git a/chrome/browser/ui/views/frame/native_browser_frame_factory_chromeos.cc b/chrome/browser/ui/views/frame/native_browser_frame_factory_chromeos.cc
index 27b59a7..6fa1b03 100644
--- a/chrome/browser/ui/views/frame/native_browser_frame_factory_chromeos.cc
+++ b/chrome/browser/ui/views/frame/native_browser_frame_factory_chromeos.cc
@@ -4,14 +4,14 @@
#include "chrome/browser/ui/views/frame/native_browser_frame_factory.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/ui/views/frame/browser_frame_ash.h"
#include "chrome/browser/ui/views/frame/browser_frame_mash.h"
+#include "ui/base/ui_base_features.h"
NativeBrowserFrame* NativeBrowserFrameFactory::Create(
BrowserFrame* browser_frame,
BrowserView* browser_view) {
- if (chromeos::GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return new BrowserFrameMash(browser_frame, browser_view);
return new BrowserFrameAsh(browser_frame, browser_view);
}
diff --git a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
index 41bd637b..4748021 100644
--- a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
+++ b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
@@ -31,10 +31,10 @@
#if defined(OS_CHROMEOS)
#include "ash/shell.h" // mash-ok
-#include "chrome/browser/chromeos/ash_config.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/interfaces/window_manager.mojom.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#endif
@@ -190,7 +190,7 @@
// TODO(sergeyu): The notification bar must be shown on the monitor that's
// being captured. Make sure it's always the case. Currently we always capture
// the primary monitor.
- if (chromeos::GetAshConfig() != ash::Config::MASH) {
+ if (features::IsAshInBrowserProcess()) {
params.context = ash::Shell::GetPrimaryRootWindow();
} else {
const display::Display primary_display =
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index b0f16c85..c1a355f 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -15,7 +15,6 @@
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
@@ -47,6 +46,7 @@
#include "ash/public/cpp/window_properties.h" // nogncheck
#include "ash/public/interfaces/window_state_type.mojom.h" // nogncheck
#include "chrome/browser/ui/ash/tablet_mode_client.h"
+#include "ui/base/ui_base_features.h"
#include "ui/wm/core/coordinate_conversion.h"
#endif
@@ -1916,7 +1916,8 @@
// TODO(erg): Temporarily disable getting location from the gesture
// recognizer in mash until the mus side/window manager side RunMoveLoop() is
// fixed to understand routing touch events. crbug.com/769507
- if (!ash_util::IsRunningInMash() && event_source_ == EVENT_SOURCE_TOUCH &&
+ if (features::IsAshInBrowserProcess() &&
+ event_source_ == EVENT_SOURCE_TOUCH &&
aura::Env::GetInstance()->is_touch_down()) {
views::Widget* widget = GetAttachedBrowserWidget();
DCHECK(widget);
diff --git a/chrome/browser/ui/views/tabs/window_finder_chromeos.cc b/chrome/browser/ui/views/tabs/window_finder_chromeos.cc
index e0d96367..aaf58e5c0 100644
--- a/chrome/browser/ui/views/tabs/window_finder_chromeos.cc
+++ b/chrome/browser/ui/views/tabs/window_finder_chromeos.cc
@@ -5,9 +5,8 @@
#include "chrome/browser/ui/views/tabs/window_finder.h"
#include "chrome/browser/ui/views/tabs/window_finder_mus.h"
-#include "ash/public/cpp/config.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "ui/aura/window.h"
+#include "ui/base/ui_base_features.h"
gfx::NativeWindow GetLocalProcessWindowAtPointAsh(
const gfx::Point& screen_point,
@@ -16,7 +15,7 @@
gfx::NativeWindow WindowFinder::GetLocalProcessWindowAtPoint(
const gfx::Point& screen_point,
const std::set<gfx::NativeWindow>& ignore) {
- if (chromeos::GetAshConfig() == ash::Config::MASH) {
+ if (!features::IsAshInBrowserProcess()) {
gfx::NativeWindow mus_result = nullptr;
if (GetLocalProcessWindowAtPointMus(screen_point, ignore, &mus_result))
return mus_result;
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
index c61c4582..d996293 100644
--- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -27,7 +27,6 @@
#include "chrome/browser/chromeos/system/timezone_resolver_manager.h"
#include "chrome/browser/chromeos/tpm_firmware_update.h"
#include "chrome/browser/lifetime/application_lifetime.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/ash/tablet_mode_client.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
@@ -47,6 +46,7 @@
#include "google_apis/google_api_keys.h"
#include "services/service_manager/public/cpp/connector.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/screen.h"
@@ -92,7 +92,7 @@
version_info_updater_(this) {
DCHECK(js_calls_container);
set_call_js_prefix(kJsScreenPath);
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
CHECK(accessibility_manager);
accessibility_subscription_ = accessibility_manager->RegisterCallback(
@@ -442,7 +442,7 @@
}
void CoreOobeHandler::UpdateA11yState() {
- if (ash_util::IsRunningInMash()) {
+ if (!features::IsAshInBrowserProcess()) {
NOTIMPLEMENTED();
return;
}
@@ -520,7 +520,7 @@
void CoreOobeHandler::UpdateKeyboardState() {
// TODO(mash): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (!ash_util::IsRunningInMash()) {
+ if (features::IsAshInBrowserProcess()) {
auto* keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled()) {
const bool is_keyboard_shown = keyboard_controller->keyboard_visible();
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index 14d2918..0cfb4cb 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -29,7 +29,6 @@
#include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/webui/about_ui.h"
#include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
@@ -86,6 +85,7 @@
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_features.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/display/display.h"
#include "ui/events/devices/input_device.h"
@@ -392,7 +392,7 @@
// TODO(felixe): Display iteration and primary display selection not supported
// in Mash. See http://crbug.com/720917.
- if (!ash_util::IsRunningInMash() && IsRemoraRequisitioned())
+ if (features::IsAshInBrowserProcess() && IsRemoraRequisitioned())
oobe_display_chooser_ = std::make_unique<OobeDisplayChooser>();
}
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index 1e546f4..8c6e8967 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -37,7 +37,6 @@
#include "chrome/browser/browser_process_platform_part_chromeos.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
-#include "chrome/browser/chromeos/ash_config.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/lock_screen_apps/state_controller.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
@@ -113,6 +112,7 @@
#include "ui/base/ime/chromeos/input_method_manager.h"
#include "ui/base/ime/chromeos/input_method_util.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/ui_base_features.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/gfx/color_analysis.h"
@@ -329,7 +329,7 @@
WallpaperControllerClient::Get()->AddObserver(std::move(ptr_info));
// TODO(tbarzic): This is needed for login UI - remove it when login switches
// to views implementation (or otherwise, make it work under mash).
- if (GetAshConfig() != ash::Config::MASH)
+ if (features::IsAshInBrowserProcess())
detachable_base_observer_.Add(ash::Shell::Get()->detachable_base_handler());
}
@@ -1747,7 +1747,7 @@
bool requires_update) {}
void SigninScreenHandler::UpdateDetachableBaseChangedError() {
- if (GetAshConfig() == ash::Config::MASH)
+ if (!features::IsAshInBrowserProcess())
return;
auto pairing_status =
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc
index d0075d3..76542bd 100644
--- a/chrome/browser/ui/webui/settings/md_settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -75,7 +75,6 @@
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h"
#include "chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h"
#include "chrome/browser/ui/webui/settings/chromeos/android_apps_handler.h"
@@ -99,6 +98,7 @@
#include "chromeos/account_manager/account_manager_factory.h"
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_util.h"
+#include "ui/base/ui_base_features.h"
#else // !defined(OS_CHROMEOS)
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h"
@@ -312,7 +312,7 @@
html_source->AddBoolean("havePlayStoreApp", arc::IsPlayStoreAvailable());
// TODO(mash): Support Chrome power settings in Mash. crbug.com/644348
- bool enable_power_settings = !ash_util::IsRunningInMash();
+ bool enable_power_settings = features::IsAshInBrowserProcess();
html_source->AddBoolean("enablePowerSettings", enable_power_settings);
if (enable_power_settings) {
AddSettingsPageUIHandler(std::make_unique<chromeos::settings::PowerHandler>(
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
index 05aee65..efde9b9 100644
--- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/ui/window_sizer/window_sizer.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"