summaryrefslogtreecommitdiff
path: root/chromium/content/app/mac/mac_init.mm
blob: eea835a02a321e769a7ac500b1e647bf573d9dbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2015 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.

#include "content/app/mac/mac_init.h"

#import <Cocoa/Cocoa.h>

#include "base/mac/mac_util.h"

namespace content {

void InitializeMac() {
  [[NSUserDefaults standardUserDefaults] registerDefaults:@{
      // Exceptions routed to -[NSApplication reportException:] should crash
      // immediately, as opposed being swallowed or presenting UI that gives the
      // user a choice in the matter.
      @"NSApplicationCrashOnExceptions": @YES,

      // Prevent Cocoa from turning command-line arguments into -[NSApplication
      // application:openFile:], because they are handled directly. @"NO" looks
      // like a mistake, but the value really is supposed to be a string.
      @"NSTreatUnknownArgumentsAsOpen": @"NO",

      // CoreAnimation has poor performance and CoreAnimation and
      // non-CoreAnimation exhibit window flickering when layers are not hosted
      // in the window server, which is the default when not not using the
      // 10.9 SDK.
      // TODO: Remove this when we build with the 10.9 SDK.
      @"NSWindowHostsLayersInWindowServer": @(base::mac::IsOSMavericksOrLater())
  }];
}

}  // namespace content