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
3// found in the LICENSE file.
4
5#include "chrome/app/chrome_main_mac.h"
6
7#import <Cocoa/Cocoa.h>
8
9#include <string>
10
11#include "base/files/file_path.h"
12#import "base/mac/bundle_locations.h"
13#import "base/mac/foundation_util.h"
14#include "base/path_service.h"
15#include "base/strings/sys_string_conversions.h"
16#include "chrome/common/chrome_constants.h"
17#include "chrome/common/chrome_paths_internal.h"
18#include "content/public/common/content_paths.h"
19
20void SetUpBundleOverrides() {
21  @autoreleasepool {
22    base::mac::SetOverrideFrameworkBundlePath(chrome::GetFrameworkBundlePath());
23
24    NSBundle* base_bundle = chrome::OuterAppBundle();
25    base::mac::SetBaseBundleID([[base_bundle bundleIdentifier] UTF8String]);
26
27    base::FilePath child_exe_path =
28        chrome::GetFrameworkBundlePath().Append("Helpers").Append(
29            chrome::kHelperProcessExecutablePath);
30
31    // On the Mac, the child executable lives at a predefined location within
32    // the app bundle's versioned directory.
33    base::PathService::Override(content::CHILD_PROCESS_EXE, child_exe_path);
34  }
35}
36