Skip to content

Commit

Permalink
removes mash/mus/window-service related features
Browse files Browse the repository at this point in the history
None of these features are used and can be removed.

BUG=973077
TEST=none

Change-Id: Iec78cab4a0d03a6ca3b9b2509db0ee77de0d662c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666649
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670759}
  • Loading branch information
Scott Violet authored and Commit Bot committed Jun 20, 2019
1 parent fb9425c commit 7618db6
Show file tree
Hide file tree
Showing 76 changed files with 102 additions and 845 deletions.
9 changes: 2 additions & 7 deletions ash/accessibility/accessibility_highlight_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "ash/shell.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/event.h"
#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/cursor_manager.h"
Expand Down Expand Up @@ -49,10 +48,7 @@ AccessibilityHighlightController::AccessibilityHighlightController() {
Shell::Get()->AddPreTargetHandler(this);
Shell::Get()->cursor_manager()->AddObserver(this);

// In-process ash uses the InputMethod shared between ash and browser. Mash
// receives caret updates from the browser over mojo.
if (!::features::IsMultiProcessMash())
GetSharedInputMethod()->AddObserver(this);
GetSharedInputMethod()->AddObserver(this);
}

AccessibilityHighlightController::~AccessibilityHighlightController() {
Expand All @@ -62,8 +58,7 @@ AccessibilityHighlightController::~AccessibilityHighlightController() {
controller->HideCaretRing();
controller->HideCursorRing();

if (!::features::IsMultiProcessMash())
GetSharedInputMethod()->RemoveObserver(this);
GetSharedInputMethod()->RemoveObserver(this);
Shell::Get()->cursor_manager()->RemoveObserver(this);
Shell::Get()->RemovePreTargetHandler(this);
}
Expand Down
7 changes: 0 additions & 7 deletions ash/display/display_color_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "base/threading/scoped_blocking_call.h"
#include "components/quirks/quirks_manager.h"
#include "third_party/qcms/src/qcms.h"
#include "ui/base/ui_base_features.h"
#include "ui/display/display.h"
#include "ui/display/types/display_constants.h"
#include "ui/display/types/display_snapshot.h"
Expand Down Expand Up @@ -324,12 +323,6 @@ bool DisplayColorManager::LoadCalibrationForDisplay(
return false;
}

// TODO: enable QuirksManager for mash. http://crbug.com/728748. Some tests
// don't create the Shell when running this code, hence the
// Shell::HasInstance() conditional.
if (Shell::HasInstance() && features::IsMultiProcessMash())
return false;

const bool valid_product_code =
display->product_code() != display::DisplaySnapshot::kInvalidProductCode;
// TODO(mcasas): correct UMA s/Id/Code/, https://crbug.com/821393.
Expand Down
20 changes: 8 additions & 12 deletions ash/display/window_tree_host_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -824,19 +824,15 @@ AshWindowTreeHost* WindowTreeHostManager::AddWindowTreeHostForDisplay(
AshWindowTreeHost* ash_host =
AshWindowTreeHost::Create(params_with_bounds).release();
aura::WindowTreeHost* host = ash_host->AsWindowTreeHost();
// Out-of-process ash uses the IME mojo service. In-process ash uses a single
// input method shared between ash and browser code.
if (!::features::IsMultiProcessMash()) {
DCHECK(!host->has_input_method());
if (!input_method_) { // Singleton input method instance for Ash.
input_method_ = ui::CreateInputMethod(this, host->GetAcceleratedWidget());
// Makes sure the input method is focused by default when created, because
// Ash uses singleton InputMethod and it won't call OnFocus/OnBlur when
// the active window changed.
input_method_->OnFocus();
}
host->SetSharedInputMethod(input_method_.get());
DCHECK(!host->has_input_method());
if (!input_method_) { // Singleton input method instance for Ash.
input_method_ = ui::CreateInputMethod(this, host->GetAcceleratedWidget());
// Makes sure the input method is focused by default when created, because
// Ash uses singleton InputMethod and it won't call OnFocus/OnBlur when
// the active window changed.
input_method_->OnFocus();
}
host->SetSharedInputMethod(input_method_.get());

host->window()->SetName(base::StringPrintf(
"%sRootWindow-%d", params_with_bounds.offscreen ? "Offscreen" : "",
Expand Down
10 changes: 1 addition & 9 deletions ash/drag_drop/drag_drop_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,20 +376,12 @@ void DragDropController::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_SCROLL_FLING_START:
Drop(translated_target, *translated_event.get());
break;
case ui::ET_GESTURE_END:
// This case occurs when IsUsingWindowService() is true and the user
// presses, pauses, and releases a touch without any movement between.
// That gesture should be interpreted as a long tap and show a menu, etc.
// Classic Ash handles this scenario below via ET_GESTURE_LONG_TAP, while
// Mash handles it in DragDropControllerMus::OnPerformDragDropCompleted.
DoDragCancel(kTouchCancelAnimationDuration);
break;
case ui::ET_GESTURE_LONG_TAP:
// Ideally we would want to just forward this long tap event to the
// |drag_source_window_|. However, webkit does not accept events while a
// drag drop is still in progress. The drag drop ends only when the nested
// message loop ends. Due to this stupidity, we have to defer forwarding
// the long tap. This only occurs when IsUsingWindowService() is false.
// the long tap.
pending_long_tap_.reset(new ui::GestureEvent(
*event,
static_cast<aura::Window*>(drag_drop_tracker_->capture_window()),
Expand Down
5 changes: 0 additions & 5 deletions ash/login/ui/lock_contents_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "components/user_manager/user_type.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/user_activity/user_activity_detector.h"
#include "ui/base/user_activity/user_activity_observer.h"
#include "ui/display/display.h"
Expand Down Expand Up @@ -967,8 +966,6 @@ void LockContentsView::OnSystemInfoChanged(
for (int i = 0; i < 3; ++i)
system_info_->AddChildView(create_info_label());
}
if (::features::IsSingleProcessMash())
system_info_->AddChildView(create_info_label());

if (show)
system_info_->SetVisible(true);
Expand All @@ -982,8 +979,6 @@ void LockContentsView::OnSystemInfoChanged(
update_label(0, os_version_label_text);
update_label(1, enterprise_info_text);
update_label(2, bluetooth_name);
if (::features::IsSingleProcessMash())
update_label(3, "SingleProcessMash");

LayoutTopHeader();
}
Expand Down
65 changes: 0 additions & 65 deletions ash/main.cc

This file was deleted.

10 changes: 1 addition & 9 deletions ash/metrics/demo_session_metrics_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,10 @@ DemoModeApp GetAppFromWindow(const aura::Window* window) {
if (app_id == extension_misc::kChromeAppId)
return DemoModeApp::kBrowser;

auto is_default = [](const std::string& app_id) {
if (!features::IsMultiProcessMash())
return app_id.empty();

return base::StartsWith(app_id, ShelfWindowWatcher::kDefaultShelfIdPrefix,
base::CompareCase::SENSITIVE);
};

// If the window is the "browser" type, having an app ID other than the
// default indicates a hosted/bookmark app.
if (app_type == AppType::CHROME_APP ||
(app_type == AppType::BROWSER && !is_default(app_id))) {
(app_type == AppType::BROWSER && !app_id.empty())) {
return GetAppFromAppId(app_id);
}

Expand Down
29 changes: 0 additions & 29 deletions ash/shelf/shelf_window_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,19 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/wm/public/activation_client.h"

namespace ash {
namespace {

// Returns the window's shelf item type property value.
// MultiProcessMash also experimentally returns TYPE_DIALOG for some windows.
ShelfItemType GetShelfItemType(aura::Window* window) {
if (features::IsMultiProcessMash() &&
window->GetProperty(kShelfItemTypeKey) == TYPE_UNDEFINED &&
window->type() == aura::client::WINDOW_TYPE_NORMAL) {
return TYPE_DIALOG;
}
return static_cast<ShelfItemType>(window->GetProperty(kShelfItemTypeKey));
}

// Returns the window's shelf id property value.
// MultiProcessMash also experimentally sets and returns default ids values.
ShelfID GetShelfID(aura::Window* window) {
if (features::IsMultiProcessMash() && !window->GetProperty(kShelfIDKey)) {
static int id = 0;
const ash::ShelfID shelf_id(ShelfWindowWatcher::kDefaultShelfIdPrefix +
std::to_string(id++));
window->SetProperty(kShelfIDKey, shelf_id.Serialize());
return shelf_id;
}
return ShelfID::Deserialize(window->GetProperty(kShelfIDKey));
}

Expand Down Expand Up @@ -116,20 +101,6 @@ void ShelfWindowWatcher::UserWindowObserver::OnWindowPropertyChanged(
aura::Window* window,
const void* key,
intptr_t old) {
// ShelfIDs should rarely change beyond replacing Mash temporary defaults.
// Support ShelfID changes by removing the item; it will be re-added below.
if (features::IsMultiProcessMash() && key == kShelfIDKey &&
window_watcher_->user_windows_with_items_.count(window) > 0) {
ShelfID old_id = ShelfID::Deserialize(reinterpret_cast<std::string*>(old));
ShelfID new_id = ShelfID::Deserialize(window->GetProperty(kShelfIDKey));
if (old_id != new_id && !old_id.IsNull() && !new_id.IsNull() &&
window_watcher_->model_->ItemIndexByID(old_id) >= 0) {
window_watcher_->user_windows_with_items_.erase(window);
const int index = window_watcher_->model_->ItemIndexByID(old_id);
window_watcher_->model_->RemoveItemAt(index);
}
}

if (key == kShelfIDKey && window == wm::GetActiveWindow()) {
window_watcher_->model_->SetActiveShelfID(
ShelfID::Deserialize(window->GetProperty(kShelfIDKey)));
Expand Down
3 changes: 0 additions & 3 deletions ash/shelf/shelf_window_watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class ShelfModel;
// ShelfWindowWatcher manages ShelfItems for dialogs in the default container
// with valid ShelfItemType and ShelfID window properties (ie. task manager).
// ShelfWindowWatcher also tracks the active shelf item via window activation.
//
// Some windows are experimentally given default properties in MultiProcessMash.
// TODO(crbug.com/722496|887156): Resolve, KSV etc. tracking approach for Mash.
class ShelfWindowWatcher : public ::wm::ActivationChangeObserver,
public ShellObserver {
public:
Expand Down
9 changes: 3 additions & 6 deletions ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,10 +845,8 @@ Shell::~Shell() {

shell_delegate_.reset();

if (!::features::IsMultiProcessMash()) {
// Must be shut down after detachable_base_handler_.
chromeos::HammerdClient::Shutdown();
}
// Must be shut down after detachable_base_handler_.
chromeos::HammerdClient::Shutdown();

for (auto& observer : shell_observers_)
observer.OnShellDestroyed();
Expand Down Expand Up @@ -1156,8 +1154,7 @@ void Shell::Init(
user_metrics_recorder_->OnShellInitialized();

// Initialize the D-Bus bus and services for ash.
if (!::features::IsMultiProcessMash())
ash_dbus_helper_ = AshDBusHelper::CreateWithExistingBus(dbus_bus);
ash_dbus_helper_ = AshDBusHelper::CreateWithExistingBus(dbus_bus);
ash_dbus_services_ = std::make_unique<AshDBusServices>(dbus_bus.get());

// By this point ash shell should have initialized its D-Bus signal
Expand Down
4 changes: 0 additions & 4 deletions ash/shell/content/embedded_browser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/ui_base_features.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/layout/fill_layout.h"
Expand All @@ -37,9 +36,6 @@ class HostWidget : public views::WidgetDelegateView {

private:
HostWidget(gfx::NativeWindow native_window) {
// Note this does not work under multi process mash.
DCHECK(!features::IsMultiProcessMash());

SetLayoutManager(std::make_unique<views::FillLayout>());

auto* widget = new views::Widget;
Expand Down
9 changes: 2 additions & 7 deletions ash/system/ime_menu/ime_menu_tray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "ui/base/ime/text_input_client.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/range/range.h"
Expand Down Expand Up @@ -80,12 +79,8 @@ bool IsInLoginOrLockScreen() {

// Returns true if the current input context type is password.
bool IsInPasswordInputContext() {
// Avoid getting IMEBridge instance if ash is not in browser.
// This is to temporarily mute the crash (http://crbug.com/867084).
// TODO(shuchen): This will be eventually be solved by the Mojo-based IMF.
return !::features::IsMultiProcessMash() &&
ui::IMEBridge::Get()->GetCurrentInputContext().type ==
ui::TEXT_INPUT_TYPE_PASSWORD;
return ui::IMEBridge::Get()->GetCurrentInputContext().type ==
ui::TEXT_INPUT_TYPE_PASSWORD;
}

class ImeMenuLabel : public views::Label {
Expand Down
16 changes: 1 addition & 15 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if (!is_android && !is_mac) {
"$root_out_dir/locales/en-US.pak",
"$root_out_dir/locales/fr.pak",
]
if (enable_hidpi || enable_mus) {
if (enable_hidpi) {
data += [ "$root_out_dir/chrome_200_percent.pak" ]
}
}
Expand Down Expand Up @@ -373,20 +373,6 @@ if (!is_android && !is_mac) {
sources += [ "app/chrome_exe_main_aura.cc" ]
}
}

# TODO(jonross): remove this once telemetry can differentiate between linux
# and linux chromiumos.
if (enable_mus) {
chrome_binary("chrome_test") {
# Note that the output name needs to end with "chrome", because that's
# what telemetry test-runner expects.
output_name = "test_chrome"
sources = []
if (!is_win && use_aura) {
sources += [ "app/chrome_exe_main_aura.cc" ]
}
}
}
} # !is_android && !is_mac

if (is_win) {
Expand Down
9 changes: 0 additions & 9 deletions chrome/browser/browser_keyevents_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/keycodes/keyboard_codes.h"

// TODO(kbr): remove: http://crbug.com/222296
Expand Down Expand Up @@ -528,14 +527,6 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CommandKeyEvents) {
#define MAYBE_AccessKeys AccessKeys
#endif
IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_AccessKeys) {
// TODO(crbug.com/916379): this test fails in mash because of differences in
// timing. In particular, in classic mode an accelerator that moves focus is
// processed *after* text is inserted, where as now the accelerator runs
// first, resulting in text going to the wrong place. The right fix likely
// entails updating the test for mash.
if (features::IsSingleProcessMash())
return;

#if defined(OS_MACOSX)
// On Mac, access keys use ctrl+alt modifiers.
static const KeyEventTestData kTestAccessA = {
Expand Down
Loading

0 comments on commit 7618db6

Please sign in to comment.