OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/app_controller_mac.h" | 5 #import "chrome/browser/app_controller_mac.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 } | 1665 } |
1666 | 1666 |
1667 - (void)passURLToHandoffManager:(const GURL&)handoffURL { | 1667 - (void)passURLToHandoffManager:(const GURL&)handoffURL { |
1668 [handoffManager_ updateActiveURL:handoffURL]; | 1668 [handoffManager_ updateActiveURL:handoffURL]; |
1669 } | 1669 } |
1670 | 1670 |
1671 - (void)updateHandoffManager:(content::WebContents*)webContents { | 1671 - (void)updateHandoffManager:(content::WebContents*)webContents { |
1672 if (![self shouldUseHandoff]) | 1672 if (![self shouldUseHandoff]) |
1673 return; | 1673 return; |
1674 | 1674 |
1675 if (!handoffManager_) | 1675 if (!handoffManager_) { |
1676 handoffManager_.reset([[HandoffManager alloc] init]); | 1676 handoffManager_.reset( |
| 1677 [[HandoffManager alloc] initWithOrigin:handoff::ORIGIN_MAC]); |
| 1678 } |
1677 | 1679 |
1678 GURL handoffURL = [self handoffURLFromWebContents:webContents]; | 1680 GURL handoffURL = [self handoffURLFromWebContents:webContents]; |
1679 [self passURLToHandoffManager:handoffURL]; | 1681 [self passURLToHandoffManager:handoffURL]; |
1680 } | 1682 } |
1681 | 1683 |
1682 - (GURL)handoffURLFromWebContents:(content::WebContents*)webContents { | 1684 - (GURL)handoffURLFromWebContents:(content::WebContents*)webContents { |
1683 if (!webContents) | 1685 if (!webContents) |
1684 return GURL(); | 1686 return GURL(); |
1685 | 1687 |
1686 Profile* profile = | 1688 Profile* profile = |
(...skipping 22 matching lines...) Expand all Loading... |
1709 | 1711 |
1710 //--------------------------------------------------------------------------- | 1712 //--------------------------------------------------------------------------- |
1711 | 1713 |
1712 namespace app_controller_mac { | 1714 namespace app_controller_mac { |
1713 | 1715 |
1714 bool IsOpeningNewWindow() { | 1716 bool IsOpeningNewWindow() { |
1715 return g_is_opening_new_window; | 1717 return g_is_opening_new_window; |
1716 } | 1718 } |
1717 | 1719 |
1718 } // namespace app_controller_mac | 1720 } // namespace app_controller_mac |
OLD | NEW |