| 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 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 isEqualToString:NSUserActivityTypeBrowsingWeb]) { | 1614 isEqualToString:NSUserActivityTypeBrowsingWeb]) { |
| 1615 return NO; | 1615 return NO; |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 NSString* originString = base::mac::ObjCCast<NSString>( | 1618 NSString* originString = base::mac::ObjCCast<NSString>( |
| 1619 [userActivity.userInfo objectForKey:handoff::kOriginKey]); | 1619 [userActivity.userInfo objectForKey:handoff::kOriginKey]); |
| 1620 handoff::Origin origin = handoff::OriginFromString(originString); | 1620 handoff::Origin origin = handoff::OriginFromString(originString); |
| 1621 UMA_HISTOGRAM_ENUMERATION( | 1621 UMA_HISTOGRAM_ENUMERATION( |
| 1622 "OSX.Handoff.Origin", origin, handoff::ORIGIN_COUNT); | 1622 "OSX.Handoff.Origin", origin, handoff::ORIGIN_COUNT); |
| 1623 | 1623 |
| 1624 NSURL* url = userActivity.webPageURL; | 1624 NSURL* url = userActivity.webpageURL; |
| 1625 if (!url) | 1625 if (!url) |
| 1626 return NO; | 1626 return NO; |
| 1627 | 1627 |
| 1628 GURL gurl(base::SysNSStringToUTF8([url absoluteString])); | 1628 GURL gurl(base::SysNSStringToUTF8([url absoluteString])); |
| 1629 std::vector<GURL> gurlVector; | 1629 std::vector<GURL> gurlVector; |
| 1630 gurlVector.push_back(gurl); | 1630 gurlVector.push_back(gurl); |
| 1631 | 1631 |
| 1632 [self openUrlsReplacingNTP:gurlVector]; | 1632 [self openUrlsReplacingNTP:gurlVector]; |
| 1633 return YES; | 1633 return YES; |
| 1634 } | 1634 } |
| 1635 | 1635 |
| 1636 - (void)application:(NSApplication*)application | 1636 - (void)application:(NSApplication*)application |
| 1637 didFailToContinueUserActivityWithType:(NSString*)userActivityType | 1637 didFailToContinueUserActivityWithType:(NSString*)userActivityType |
| 1638 error:(NSError*)error { | 1638 error:(NSError*)error { |
| 1639 } | 1639 } |
| 1640 | 1640 |
| 1641 @end // @implementation AppController | 1641 @end // @implementation AppController |
| 1642 | 1642 |
| 1643 //--------------------------------------------------------------------------- | 1643 //--------------------------------------------------------------------------- |
| 1644 | 1644 |
| 1645 namespace app_controller_mac { | 1645 namespace app_controller_mac { |
| 1646 | 1646 |
| 1647 bool IsOpeningNewWindow() { | 1647 bool IsOpeningNewWindow() { |
| 1648 return g_is_opening_new_window; | 1648 return g_is_opening_new_window; |
| 1649 } | 1649 } |
| 1650 | 1650 |
| 1651 } // namespace app_controller_mac | 1651 } // namespace app_controller_mac |
| OLD | NEW |