OLD | NEW |
---|---|
(Empty) | |
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 #ifndef BASE_MAC_BUNDLE_LOCATIONS_H_ | |
6 #define BASE_MAC_BUNDLE_LOCATIONS_H_ | |
7 #pragma once | |
8 | |
9 #include "base/base_export.h" | |
10 #include "base/file_path.h" | |
11 | |
12 #if defined(__OBJC__) | |
13 #import <Foundation/Foundation.h> | |
14 #else // __OBJC__ | |
15 class NSBundle; | |
16 class NSString; | |
17 #endif // __OBJC__ | |
18 | |
19 class FilePath; | |
20 | |
21 namespace base { | |
22 namespace mac { | |
23 | |
24 // This file provides several functions to explicitly request the various | |
25 // component bundles of Chrome. Please use these methods rather than calling | |
26 // +[NSBundle mainBundle] or CFBundleGetMainBundle(). | |
27 // | |
28 // Terminology | |
29 // - "Outer Bundle" - This is the main bundle for Chrome, it's what | |
Avi (use Gerrit)
2012/01/10 15:37:13
semicolon after 'Chrome' rather than comma
jeremy
2012/01/11 07:12:44
Done.
| |
30 // +[NSBundle mainBundle] returns when Chrome is launched normally. | |
31 // | |
32 // - "Launch Bundle" - This is the bundle from which Chrome was launched. | |
33 // usually this should be the same as the outer bundle except when Chrome | |
Avi (use Gerrit)
2012/01/10 15:37:13
"Usually this should" is pleonastic. Try
This wil
jeremy
2012/01/11 07:12:44
Done.
| |
34 // is launched via an app shortcut in which case this will return the app | |
35 // shortcut's bundle rather than the main Chrome bundle. | |
36 // | |
37 // - "Framework Bundle" - Bundle corresponding to the Chrome framework. | |
Avi (use Gerrit)
2012/01/10 15:37:13
First two items in the list were "This is the bund
jeremy
2012/01/11 07:12:44
Done.
| |
38 // | |
39 // Guidelines for use: | |
40 // - To access a resource, the Framework bundle should be used. | |
41 // - If the choice is between the Outer or Launch bundles then please chose | |
Avi (use Gerrit)
2012/01/10 15:37:13
s/chose/choose/
jeremy
2012/01/11 07:12:44
Done.
| |
42 // carefully. Most often the Outer bundle will be the right choice, but for | |
43 // cases such as adding an app to the "launch on startup" list, the Launch | |
44 // bundle is probably the one to use. | |
45 | |
46 // Methods for retrieving the various bundles. | |
47 BASE_EXPORT NSBundle* LaunchBundle(); | |
48 BASE_EXPORT FilePath LaunchBundleBundlePath(); | |
Avi (use Gerrit)
2012/01/10 15:37:13
Why two 'Bundle's here but one in OuterBundlePath?
jeremy
2012/01/11 07:12:44
Done.
| |
49 BASE_EXPORT NSBundle* OuterBundle(); | |
50 BASE_EXPORT FilePath OuterBundlePath(); | |
51 BASE_EXPORT NSBundle* FrameworkBundle(); | |
Avi (use Gerrit)
2012/01/10 15:37:13
FrameworkBundlePath isn't needed?
jeremy
2012/01/11 07:12:44
Done.
| |
52 | |
53 // Set the bundle that MainAppBundle will return, overriding the default value | |
Avi (use Gerrit)
2012/01/10 15:37:13
There is no MainAppBundle nor SetOverrideAppBundle
jeremy
2012/01/11 07:12:44
Done.
| |
54 // (Restore the default by calling SetOverrideAppBundle(nil)). | |
55 BASE_EXPORT void SetOverrideLaunchBundle(NSBundle* bundle); | |
56 BASE_EXPORT void SetOverrideFrameworkBundle(NSBundle* bundle); | |
57 BASE_EXPORT void SetOverrideOuterBundle(NSBundle* bundle); | |
Mark Mentovai
2012/01/10 22:09:35
This is replacing base/mac/foundation_util base::m
jeremy
2012/01/11 07:12:44
Done.
| |
58 | |
Mark Mentovai
2012/01/10 22:09:35
Maybe we should just have
// In the .h:
enum Whi
jeremy
2012/01/11 07:12:44
Personally I prefer the method in this patch to th
| |
59 } // namespace mac | |
60 } // namespace base | |
61 | |
62 #endif // #ifndef BASE_MAC_BUNDLE_LOCATIONS_H_ | |
Mark Mentovai
2012/01/10 22:09:35
No #ifndef in the comment.
jeremy
2012/01/11 07:12:44
Done.
| |
OLD | NEW |