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

Side by Side Diff: chrome/browser/mac/relauncher.mm

Issue 2398943002: [mac] Use -[NSApp isActive] for checking if current app is active. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/mac/relauncher.h" 5 #include "chrome/browser/mac/relauncher.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include <AvailabilityMacros.h> 9 #include <AvailabilityMacros.h>
10 #include <crt_externs.h> 10 #include <crt_externs.h>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 bool RelaunchAppWithHelper(const std::string& helper, 94 bool RelaunchAppWithHelper(const std::string& helper,
95 const std::vector<std::string>& relauncher_args, 95 const std::vector<std::string>& relauncher_args,
96 const std::vector<std::string>& args) { 96 const std::vector<std::string>& args) {
97 std::vector<std::string> relaunch_args; 97 std::vector<std::string> relaunch_args;
98 relaunch_args.push_back(helper); 98 relaunch_args.push_back(helper);
99 relaunch_args.push_back(RelauncherTypeArg()); 99 relaunch_args.push_back(RelauncherTypeArg());
100 100
101 // If this application isn't in the foreground, the relaunched one shouldn't 101 // If this application isn't in the foreground, the relaunched one shouldn't
102 // be either. 102 // be either.
103 if (![[NSRunningApplication currentApplication] isActive]) { 103 if (![NSApp isActive]) {
104 relaunch_args.push_back(kRelauncherBackgroundArg); 104 relaunch_args.push_back(kRelauncherBackgroundArg);
105 } 105 }
106 106
107 relaunch_args.insert(relaunch_args.end(), 107 relaunch_args.insert(relaunch_args.end(),
108 relauncher_args.begin(), relauncher_args.end()); 108 relauncher_args.begin(), relauncher_args.end());
109 109
110 relaunch_args.push_back(kRelauncherArgSeparator); 110 relaunch_args.push_back(kRelauncherArgSeparator);
111 111
112 // When using the CommandLine interface, -psn_ may have been rewritten as 112 // When using the CommandLine interface, -psn_ may have been rewritten as
113 // --psn_. Look for both. 113 // --psn_. Look for both.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 if (!dmg_bsd_device_name.empty()) { 367 if (!dmg_bsd_device_name.empty()) {
368 EjectAndTrashDiskImage(dmg_bsd_device_name); 368 EjectAndTrashDiskImage(dmg_bsd_device_name);
369 } 369 }
370 370
371 return 0; 371 return 0;
372 } 372 }
373 373
374 } // namespace internal 374 } // namespace internal
375 375
376 } // namespace mac_relauncher 376 } // namespace mac_relauncher
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698