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

Unified Diff: components/arc/clipboard/arc_clipboard_bridge.h

Issue 1495723004: Minimum implementation of ARC clipboard Bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tryboy warnings Created 4 years, 11 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: components/arc/clipboard/arc_clipboard_bridge.h
diff --git a/components/arc/clipboard/arc_clipboard_bridge.h b/components/arc/clipboard/arc_clipboard_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..2d79b0180458524a5040f9dfd17dfb31f767c371
--- /dev/null
+++ b/components/arc/clipboard/arc_clipboard_bridge.h
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
elijahtaylor1 2016/01/07 22:04:29 nit: 2016 for new files now
cnwan 2016/01/08 06:51:46 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_ARC_CLIPBOARD_ARC_CLIPBOARD_BRIDGE_H_
+#define COMPONENTS_ARC_CLIPBOARD_ARC_CLIPBOARD_BRIDGE_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "components/arc/arc_bridge_service.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace arc {
+
+class ArcClipboardBridge : public ArcBridgeService::Observer,
+ public ClipboardHost {
+ public:
+ explicit ArcClipboardBridge(ArcBridgeService* bridge_service);
+ ~ArcClipboardBridge() override;
+
+ // ArcBridgeService::Observer overrides.
+ void OnClipboardInstanceReady() override;
+
+ // ClipboardHost overrides.
+ void SetTextContent(const mojo::String& text) override;
+ void GetTextContent() override;
+
+ private:
+ bool CalledOnValidThread();
+
+ ArcBridgeService* bridge_service_;
+
+ mojo::Binding<ClipboardHost> binding_;
+
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcClipboardBridge);
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_CLIPBOARD_ARC_CLIPBOARD_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698