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

Unified Diff: ash/common/accelerators/accelerator_controller.h

Issue 2552483002: mash: Have chrome set itself as a controller interface for changing volume (Closed)
Patch Set: comment Created 4 years 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
« no previous file with comments | « no previous file | ash/common/accelerators/accelerator_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/accelerator_controller.h
diff --git a/ash/common/accelerators/accelerator_controller.h b/ash/common/accelerators/accelerator_controller.h
index 7a5ae515da4a2323719d2ed466c1f35fd8e394a8..38b9007edbebd90702c6fd39435788865b64e1ff 100644
--- a/ash/common/accelerators/accelerator_controller.h
+++ b/ash/common/accelerators/accelerator_controller.h
@@ -14,10 +14,11 @@
#include "ash/ash_export.h"
#include "ash/common/accelerators/accelerator_table.h"
#include "ash/common/accelerators/exit_warning_handler.h"
-#include "ash/public/interfaces/volume.mojom.h"
+#include "ash/public/interfaces/accelerator_controller.mojom.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/accelerator_history.h"
@@ -36,7 +37,9 @@ class ImeControlDelegate;
// AcceleratorController provides functions for registering or unregistering
// global keyboard accelerators, which are handled earlier than any windows. It
// also implements several handlers as an accelerator target.
-class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
+class ASH_EXPORT AcceleratorController
+ : public ui::AcceleratorTarget,
+ NON_EXPORTED_BASE(public mojom::AcceleratorController) {
public:
AcceleratorController(AcceleratorControllerDelegate* delegate,
ui::AcceleratorManagerDelegate* manager_delegate);
@@ -121,6 +124,12 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
bool CanHandleAccelerators() const override;
+ // Binds the mojom::AcceleratorController interface to this object.
+ void BindRequest(mojom::AcceleratorControllerRequest request);
+
+ // mojom::AcceleratorController:
+ void SetVolumeController(mojom::VolumeControllerPtr controller) override;
+
private:
FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators);
FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest,
@@ -156,10 +165,6 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
AcceleratorProcessingRestriction GetAcceleratorProcessingRestriction(
int action);
- // Returns the volume controller interface raw pointer, may be null in tests.
- mojom::VolumeController* GetVolumeController();
- void OnVolumeControllerConnectionError();
-
AcceleratorControllerDelegate* delegate_;
std::unique_ptr<ui::AcceleratorManager> accelerator_manager_;
@@ -181,7 +186,11 @@ class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget {
actions_with_deprecations_;
std::set<ui::Accelerator> deprecated_accelerators_;
- // The cached volume controller interface pointer.
+ // Bindings for the mojom::AcceleratorController interface.
+ mojo::BindingSet<mojom::AcceleratorController> bindings_;
+
+ // Volume controller interface in chrome browser. May be null in tests. Exists
+ // because chrome owns the CrasAudioHandler dbus communication.
mojom::VolumeControllerPtr volume_controller_;
// Actions allowed when the user is not signed in.
« no previous file with comments | « no previous file | ash/common/accelerators/accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698