color_panel_bridge.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_
  5. #define COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_
  6. #include "components/remote_cocoa/app_shim/remote_cocoa_app_shim_export.h"
  7. #include "components/remote_cocoa/common/color_panel.mojom.h"
  8. #include "mojo/public/cpp/bindings/pending_remote.h"
  9. #include "mojo/public/cpp/bindings/remote.h"
  10. namespace remote_cocoa {
  11. // A bridge between the mojo ColorPanel interface and the Objective C
  12. // ColorPanelListener.
  13. class REMOTE_COCOA_APP_SHIM_EXPORT ColorPanelBridge
  14. : public remote_cocoa::mojom::ColorPanel {
  15. public:
  16. ColorPanelBridge(mojo::PendingRemote<mojom::ColorPanelHost> host);
  17. ~ColorPanelBridge() override;
  18. mojom::ColorPanelHost* host() { return host_.get(); }
  19. // mojom::ColorPanel.
  20. void Show(uint32_t initial_color, ShowCallback callback) override;
  21. void SetSelectedColor(uint32_t color,
  22. SetSelectedColorCallback callback) override;
  23. private:
  24. mojo::Remote<mojom::ColorPanelHost> host_;
  25. };
  26. } // namespace remote_cocoa
  27. #endif // COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_