mac: Allow Chrome to hand off its active URL to other devices.
commit708abc5b0abb5e0916d779bf6d1342fd472a2aa1
authorerikchen <erikchen@chromium.org>
Thu, 11 Dec 2014 03:02:21 +0000 (10 19:02 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Dec 2014 03:02:48 +0000 (11 03:02 +0000)
treed7e49b659b69c72277a7dbea5f46a73b69726c5b
parent30aa391bdd4576e76907ade361f3883b659c566d
mac: Allow Chrome to hand off its active URL to other devices.

This CL adds the class HandoffManager, which is responsible for interfacing
with Apple's Handoff APIs. It takes a GURL, and exposes that GURL to Handoff.

This CL adds the class ActiveWebContentsObserver, which is responsible for
listening to changes to the active browser, the active tab, and the visible
URL. It notifies its delegate when any of this state might have changed.

AppControllerMac is the delegate of ActiveWebContentsObserver, as well as the
owner of the HandoffManager. When it receives a delegate callback, it passes an
updated GURL to the HandoffManager. There is some minimal logic in
AppControllerMac that prevents URLs from incognito windows from being passed to
the HandoffManager.

BUG=431051, 438823

Review URL: https://codereview.chromium.org/767143007

Cr-Commit-Position: refs/heads/master@{#307846}
13 files changed:
base/mac/sdk_forward_declarations.h
chrome/browser/app_controller_mac.h
chrome/browser/app_controller_mac.mm
chrome/browser/app_controller_mac_browsertest.mm
chrome/browser/ui/cocoa/handoff_active_url_observer.cc [new file with mode: 0644]
chrome/browser/ui/cocoa/handoff_active_url_observer.h [new file with mode: 0644]
chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h [new file with mode: 0644]
chrome/chrome_browser_ui.gypi
components/OWNERS
components/handoff.gypi
components/handoff/DEPS [new file with mode: 0644]
components/handoff/handoff_manager.h [new file with mode: 0644]
components/handoff/handoff_manager.mm [new file with mode: 0644]