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 5 #ifndef COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_ 6 #define COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_ 7 8 #include "components/remote_cocoa/app_shim/remote_cocoa_app_shim_export.h" 9 #include "components/remote_cocoa/common/color_panel.mojom.h" 10 #include "mojo/public/cpp/bindings/pending_remote.h" 11 #include "mojo/public/cpp/bindings/remote.h" 12 13 namespace remote_cocoa { 14 15 // A bridge between the mojo ColorPanel interface and the Objective C 16 // ColorPanelListener. 17 class REMOTE_COCOA_APP_SHIM_EXPORT ColorPanelBridge 18 : public remote_cocoa::mojom::ColorPanel { 19 public: 20 ColorPanelBridge(mojo::PendingRemote<mojom::ColorPanelHost> host); 21 ~ColorPanelBridge() override; host()22 mojom::ColorPanelHost* host() { return host_.get(); } 23 24 // mojom::ColorPanel. 25 void Show(uint32_t initial_color) override; 26 void SetSelectedColor(uint32_t color) override; 27 28 private: 29 mojo::Remote<mojom::ColorPanelHost> host_; 30 }; 31 32 } // namespace remote_cocoa 33 34 #endif // COMPONENTS_REMOTE_COCOA_APP_SHIM_COLOR_PANEL_BRIDGE_H_ 35