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

Unified Diff: chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h

Issue 794853004: Reland 1: "mac: Allow Chrome to hand off its active URL to other devices." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 6 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
Index: chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h b/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..0d00961d4cc8473074a560f1a5ac89b08b8e24e5
--- /dev/null
+++ b/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h
@@ -0,0 +1,47 @@
+// Copyright 2014 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.
+
+#ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_
+#define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h"
+
+namespace content {
+class WebContents;
+}
+
+class HandoffActiveURLObserver;
+
+// A protocol that allows ObjC objects to receive delegate callbacks from
+// HandoffActiveURLObserver.
+@protocol HandoffActiveURLObserverBridgeDelegate
+- (void)handoffActiveURLChanged:(content::WebContents*)webContents;
+@end
+
+// This class allows an ObjC object to receive the delegate callbacks from an
+// HandoffActiveURLObserver.
+class HandoffActiveURLObserverBridge : public HandoffActiveURLObserverDelegate {
+ public:
+ explicit HandoffActiveURLObserverBridge(
+ NSObject<HandoffActiveURLObserverBridgeDelegate>* delegate);
+
+ ~HandoffActiveURLObserverBridge() override;
+
+ private:
+ void HandoffActiveURLChanged(content::WebContents* web_contents) override;
+
+ // Instances of this class should be owned by their |delegate_|.
+ NSObject<HandoffActiveURLObserverBridgeDelegate>* delegate_;
+
+ // The C++ object that this class acts as a bridge for.
+ scoped_ptr<HandoffActiveURLObserver> observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(HandoffActiveURLObserverBridge);
+};
+
+#endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_
« no previous file with comments | « chrome/browser/ui/cocoa/handoff_active_url_observer.cc ('k') | chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698