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

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 481563002: Mac: Support default browser Handoff in Yosemite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « chrome/app/app-Info.plist ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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:
1557 (void (^)(NSArray* restorableObjects))restorationHandler {
Avi (use Gerrit) 2014/08/15 22:51:00 Do you need the name "restorableObjects" here? My
erikchen 2014/08/15 22:56:26 We don't. I removed it.
1558 if (![userActivity.activityType
1559 isEqualToString:NSUserActivityTypeBrowsingWeb]) {
1560 return NO;
1561 }
1562
1563 NSURL* url = userActivity.webPageURL;
1564 if (!url)
1565 return NO;
1566
1567 GURL gurl(base::SysNSStringToUTF8([url absoluteString]));
1568 std::vector<GURL> gurlVector;
1569 gurlVector.push_back(gurl);
1570
1571 [self openUrls:gurlVector];
1572 return YES;
1573 }
1574
1575 - (void)application:(NSApplication*)application
1576 didFailToContinueUserActivityWithType:(NSString*)userActivityType
1577 error:(NSError*)error {
1578 }
1579
1549 @end // @implementation AppController 1580 @end // @implementation AppController
1550 1581
1551 //--------------------------------------------------------------------------- 1582 //---------------------------------------------------------------------------
1552 1583
1553 namespace app_controller_mac { 1584 namespace app_controller_mac {
1554 1585
1555 bool IsOpeningNewWindow() { 1586 bool IsOpeningNewWindow() {
1556 return g_is_opening_new_window; 1587 return g_is_opening_new_window;
1557 } 1588 }
1558 1589
1559 } // namespace app_controller_mac 1590 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « chrome/app/app-Info.plist ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698