Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: services/ui/ws/accessibility_manager.cc

Issue 2127383003: mus: Introduce high-contrast mode in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/accessibility_manager.cc
diff --git a/services/ui/ws/accessibility_manager.cc b/services/ui/ws/accessibility_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce6b656318b2410b876fb4fa80f6a2424614f70e
--- /dev/null
+++ b/services/ui/ws/accessibility_manager.cc
@@ -0,0 +1,33 @@
+// Copyright 2016 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 "services/ui/ws/accessibility_manager.h"
+
+#include "services/ui/ws/window_server.h"
+
+namespace ui {
+namespace ws {
+
+AccessibilityManager::AccessibilityManager(WindowServer* window_server)
+ : window_server_(window_server), binding_(this) {
+ DCHECK(window_server_);
+}
+
+AccessibilityManager::~AccessibilityManager() {}
+
+void AccessibilityManager::Bind(mojom::AccessibilityManagerRequest request) {
+ if (binding_.is_bound())
sky 2016/07/08 16:45:00 nit: I'm pretty sure you can always call binding_.
sadrul 2016/07/08 17:33:25 Done.
+ binding_.Close();
+ binding_.Bind(std::move(request));
+ binding_.set_connection_error_handler(
+ base::Bind(&mojo::Binding<mojom::AccessibilityManager>::Close,
sky 2016/07/08 16:45:00 Do you really need this? Seems like it doesn't mat
sadrul 2016/07/08 17:33:25 Cool. Removed.
+ base::Unretained(&binding_)));
+}
+
+void AccessibilityManager::SetHighContrastMode(bool enabled) {
+ window_server_->SetHighContrastMode(enabled);
sky 2016/07/08 16:45:00 Isn't high contrast mode specific to a user and no
sadrul 2016/07/08 17:33:25 Oh yeah, good point. Fixed.
+}
+
+} // namespace ws
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698