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 "apps/app_shim/extension_app_shim_handler_mac.h" | 7 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 [self performSelector:@selector(delayedScreenParametersUpdate) | 1539 [self performSelector:@selector(delayedScreenParametersUpdate) |
1540 withObject:nil | 1540 withObject:nil |
1541 afterDelay:0]; | 1541 afterDelay:0]; |
1542 } | 1542 } |
1543 | 1543 |
1544 - (void)delayedScreenParametersUpdate { | 1544 - (void)delayedScreenParametersUpdate { |
1545 FOR_EACH_OBSERVER(ui::WorkAreaWatcherObserver, workAreaChangeObservers_, | 1545 FOR_EACH_OBSERVER(ui::WorkAreaWatcherObserver, workAreaChangeObservers_, |
1546 WorkAreaChanged()); | 1546 WorkAreaChanged()); |
1547 } | 1547 } |
1548 | 1548 |
| 1549 - (BOOL)application:(NSApplication*)application |
| 1550 willContinueUserActivityWithType:(NSString*)userActivityType { |
| 1551 return [userActivityType isEqualToString:NSUserActivityTypeBrowsingWeb]; |
| 1552 } |
| 1553 |
| 1554 - (BOOL)application:(NSApplication*)application |
| 1555 continueUserActivity:(NSUserActivity*)userActivity |
| 1556 restorationHandler:(void (^)(NSArray*))restorationHandler { |
| 1557 if (![userActivity.activityType |
| 1558 isEqualToString:NSUserActivityTypeBrowsingWeb]) { |
| 1559 return NO; |
| 1560 } |
| 1561 |
| 1562 NSURL* url = userActivity.webPageURL; |
| 1563 if (!url) |
| 1564 return NO; |
| 1565 |
| 1566 GURL gurl(base::SysNSStringToUTF8([url absoluteString])); |
| 1567 std::vector<GURL> gurlVector; |
| 1568 gurlVector.push_back(gurl); |
| 1569 |
| 1570 [self openUrls:gurlVector]; |
| 1571 return YES; |
| 1572 } |
| 1573 |
| 1574 - (void)application:(NSApplication*)application |
| 1575 didFailToContinueUserActivityWithType:(NSString*)userActivityType |
| 1576 error:(NSError*)error { |
| 1577 } |
| 1578 |
1549 @end // @implementation AppController | 1579 @end // @implementation AppController |
1550 | 1580 |
1551 //--------------------------------------------------------------------------- | 1581 //--------------------------------------------------------------------------- |
1552 | 1582 |
1553 namespace app_controller_mac { | 1583 namespace app_controller_mac { |
1554 | 1584 |
1555 bool IsOpeningNewWindow() { | 1585 bool IsOpeningNewWindow() { |
1556 return g_is_opening_new_window; | 1586 return g_is_opening_new_window; |
1557 } | 1587 } |
1558 | 1588 |
1559 } // namespace app_controller_mac | 1589 } // namespace app_controller_mac |
OLD | NEW |