summaryrefslogtreecommitdiffstats
path: root/chrome/browser/mac/nsprocessinfo_additions.mm
blob: 05b8cb0e1f08a2fb7c4af45ee9eaf0b8e1f7a638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "chrome/browser/mac/nsprocessinfo_additions.h"

#import "content/public/common/content_switches.h"

@implementation NSProcessInfo(ChromeAdditions)

- (BOOL)cr_isMainBrowserOrTestProcess {
  NSString* processTypeString =
      [NSString stringWithFormat:@"--%s=", switches::kProcessType];

  for (NSString *argument in [self arguments]) {
    if ([argument hasPrefix:processTypeString])
      return NO;
  }
  return YES;
}

@end