diff options
54 files changed, 141 insertions, 104 deletions
diff --git a/base/file_version_info_mac.mm b/base/file_version_info_mac.mm index b87dbcb..93191e0c 100644 --- a/base/file_version_info_mac.mm +++ b/base/file_version_info_mac.mm @@ -8,6 +8,7 @@ #include "base/file_path.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/sys_string_conversions.h" @@ -19,7 +20,7 @@ FileVersionInfoMac::~FileVersionInfoMac() {} // static FileVersionInfo* FileVersionInfo::CreateFileVersionInfoForCurrentModule() { - return CreateFileVersionInfo(base::mac::MainAppBundlePath()); + return CreateFileVersionInfo(base::mac::FrameworkBundlePath()); } // static diff --git a/base/mac/foundation_util.h b/base/mac/foundation_util.h index 580680c..67e41e1 100644 --- a/base/mac/foundation_util.h +++ b/base/mac/foundation_util.h @@ -43,12 +43,6 @@ BASE_EXPORT void SetOverrideAmIBundled(bool value); // Returns true if this process is marked as a "Background only process". BASE_EXPORT bool IsBackgroundOnlyProcess(); -// Returns the main bundle or the override, used for code that needs -// to fetch resources from bundles, but work within a unittest where we -// aren't a bundle. -BASE_EXPORT NSBundle* MainAppBundle(); -BASE_EXPORT FilePath MainAppBundlePath(); - // Returns the path to a resource within the framework bundle. FilePath PathForFrameworkBundleResource(CFStringRef resourceName); diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index 519af45..6feeaf4 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm @@ -68,14 +68,6 @@ bool IsBackgroundOnlyProcess() { return [[info_dictionary objectForKey:@"LSUIElement"] boolValue] != NO; } -NSBundle* MainAppBundle() { - return base::mac::FrameworkBundle(); -} - -FilePath MainAppBundlePath() { - return base::mac::FrameworkBundlePath(); -} - FilePath PathForFrameworkBundleResource(CFStringRef resourceName) { NSBundle* bundle = base::mac::FrameworkBundle(); NSString* resourcePath = [bundle pathForResource:(NSString*)resourceName diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index 4f00932..3617b6a 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -14,6 +14,7 @@ #include "base/file_path.h" #include "base/file_util.h" #import "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #import "base/mac/scoped_nsautorelease_pool.h" @@ -113,7 +114,7 @@ void InitCrashReporter() { // Helper processes may not have access to the disk or to the same data as // the browser process, so the browser passes the decision to them on the // command line. - NSBundle* main_bundle = base::mac::MainAppBundle(); + NSBundle* main_bundle = base::mac::FrameworkBundle(); bool is_browser = !base::mac::IsBackgroundOnlyProcess(); bool enable_breakpad = false; CommandLine* command_line = CommandLine::ForCurrentProcess(); diff --git a/chrome/app/chrome_main_mac.h b/chrome/app/chrome_main_mac.h index 6fafd47..6d65912 100644 --- a/chrome/app/chrome_main_mac.h +++ b/chrome/app/chrome_main_mac.h @@ -12,7 +12,7 @@ class FilePath; // |user_data_dir| parameter. If no policy is set the parameter is not changed. void CheckUserDataDirPolicy(FilePath* user_data_dir); -// Sets the app bundle (base::mac::MainAppBundle()) to the framework's bundle, +// Sets the app bundle (base::mac::FrameworkBundle()) to the framework's bundle, // and sets the base bundle ID (base::mac::BaseBundleID()) to the proper value // based on the running application. The base bundle ID is the outer browser // application's bundle ID even when running in a non-browser (helper) diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index b767e22..6743e864 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/file_path.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/scoped_nsobject.h" #include "base/path_service.h" @@ -96,7 +97,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { // Now load the nib (from the right bundle). scoped_nsobject<NSNib> nib([[NSNib alloc] initWithNibNamed:@"MainMenu" - bundle:base::mac::MainAppBundle()]); + bundle:base::mac::FrameworkBundle()]); // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you // change this, you'll probably need to change the Valgrind suppression. [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; diff --git a/chrome/browser/mac/authorization_util.mm b/chrome/browser/mac/authorization_util.mm index 29b813d..3c9504f 100644 --- a/chrome/browser/mac/authorization_util.mm +++ b/chrome/browser/mac/authorization_util.mm @@ -12,6 +12,7 @@ #include "base/basictypes.h" #include "base/eintr_wrapper.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #import "base/mac/mac_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" @@ -41,8 +42,8 @@ AuthorizationRef AuthorizationCreateToRunAsRoot(CFStringRef prompt) { // product_logo_32.png is used instead of app.icns because Authorization // Services can't deal with .icns files. NSString* icon_path = - [base::mac::MainAppBundle() pathForResource:@"product_logo_32" - ofType:@"png"]; + [base::mac::FrameworkBundle() pathForResource:@"product_logo_32" + ofType:@"png"]; const char* icon_path_c = [icon_path fileSystemRepresentation]; size_t icon_path_length = icon_path_c ? strlen(icon_path_c) : 0; diff --git a/chrome/browser/mac/install_from_dmg.mm b/chrome/browser/mac/install_from_dmg.mm index 6f276b8..6447364 100644 --- a/chrome/browser/mac/install_from_dmg.mm +++ b/chrome/browser/mac/install_from_dmg.mm @@ -21,6 +21,7 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #import "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsautorelease_pool.h" @@ -435,7 +436,7 @@ bool MaybeInstallFromDiskImage() { } NSString* installer_path = - [base::mac::MainAppBundle() pathForResource:@"install" ofType:@"sh"]; + [base::mac::FrameworkBundle() pathForResource:@"install" ofType:@"sh"]; if (!installer_path) { VLOG(1) << "Could not locate install.sh"; return false; diff --git a/chrome/browser/mac/keystone_glue.mm b/chrome/browser/mac/keystone_glue.mm index 6704e3c..6413ffd 100644 --- a/chrome/browser/mac/keystone_glue.mm +++ b/chrome/browser/mac/keystone_glue.mm @@ -13,6 +13,7 @@ #include "base/file_util.h" #include "base/location.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "base/mac/scoped_nsexception_enabler.h" @@ -414,9 +415,9 @@ NSString* const kVersionKey = @"KSVersion"; return NO; // Load the KeystoneRegistration framework bundle if present. It lives - // inside the framework, so use base::mac::MainAppBundle(); + // inside the framework, so use base::mac::FrameworkBundle(); NSString* ksrPath = - [[base::mac::MainAppBundle() privateFrameworksPath] + [[base::mac::FrameworkBundle() privateFrameworksPath] stringByAppendingPathComponent:@"KeystoneRegistration.framework"]; NSBundle* ksrBundle = [NSBundle bundleWithPath:ksrPath]; [ksrBundle load]; @@ -745,7 +746,7 @@ NSString* const kVersionKey = @"KSVersion"; // to files and directories. NSFileManager* fileManager = [NSFileManager defaultManager]; NSString* executablePath = [[NSBundle mainBundle] executablePath]; - NSString* frameworkPath = [base::mac::MainAppBundle() bundlePath]; + NSString* frameworkPath = [base::mac::FrameworkBundle() bundlePath]; return ![fileManager isWritableFileAtPath:appPath_] || ![fileManager isWritableFileAtPath:executablePath] || ![fileManager isWritableFileAtPath:frameworkPath]; @@ -830,8 +831,9 @@ NSString* const kVersionKey = @"KSVersion"; // However, preflight operation (and promotion) should only be asynchronous // if the synchronous parameter is NO. NSString* preflightPath = - [base::mac::MainAppBundle() pathForResource:@"keystone_promote_preflight" - ofType:@"sh"]; + [base::mac::FrameworkBundle() + pathForResource:@"keystone_promote_preflight" + ofType:@"sh"]; const char* preflightPathC = [preflightPath fileSystemRepresentation]; const char* userBrandFile = NULL; const char* systemBrandFile = NULL; @@ -916,8 +918,9 @@ NSString* const kVersionKey = @"KSVersion"; SEL selector = @selector(changePermissionsForPromotionWithTool:); NSString* toolPath = - [base::mac::MainAppBundle() pathForResource:@"keystone_promote_postflight" - ofType:@"sh"]; + [base::mac::FrameworkBundle() + pathForResource:@"keystone_promote_postflight" + ofType:@"sh"]; PerformBridge::PostPerform(self, selector, toolPath); } diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm index 8821595..be2f6af 100644 --- a/chrome/browser/shell_integration_mac.mm +++ b/chrome/browser/shell_integration_mac.mm @@ -4,6 +4,7 @@ #include "chrome/browser/shell_integration.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/mac/foundation_util.h" #include "chrome/common/chrome_version_info.h" @@ -21,7 +22,7 @@ bool ShellIntegration::SetAsDefaultBrowser() { if (!CanSetAsDefaultBrowser()) return false; - // We really do want the main bundle here, not base::mac::MainAppBundle(), + // We really do want the main bundle here, not base::mac::FrameworkBundle(), // which is the bundle for the framework. NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; if (!identifier) @@ -41,7 +42,7 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { if (!CanSetAsDefaultProtocolClient()) return false; - // We really do want the main bundle here, not base::mac::MainAppBundle(), + // We really do want the main bundle here, not base::mac::FrameworkBundle(), // which is the bundle for the framework. NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; if (!identifier) @@ -95,7 +96,7 @@ bool IsIdentifierDefaultProtocolClient(NSString* identifier, // protocols; we don't want to report "no" here if the user has simply chosen // to open HTML files in a text editor and FTP links with an FTP client.) ShellIntegration::DefaultWebClientState ShellIntegration::IsDefaultBrowser() { - // We really do want the main bundle here, not base::mac::MainAppBundle(), + // We really do want the main bundle here, not base::mac::FrameworkBundle(), // which is the bundle for the framework. NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier]; if (!my_identifier) @@ -117,7 +118,7 @@ ShellIntegration::DefaultWebClientState if (protocol.empty()) return UNKNOWN_DEFAULT_WEB_CLIENT; - // We really do want the main bundle here, not base::mac::MainAppBundle(), + // We really do want the main bundle here, not base::mac::FrameworkBundle(), // which is the bundle for the framework. NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier]; if (!my_identifier) diff --git a/chrome/browser/ui/cocoa/about_ipc_controller.mm b/chrome/browser/ui/cocoa/about_ipc_controller.mm index b0d7c14..7a3654a 100644 --- a/chrome/browser/ui/cocoa/about_ipc_controller.mm +++ b/chrome/browser/ui/cocoa/about_ipc_controller.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" @@ -86,8 +87,8 @@ AboutIPCController* gSharedController = nil; } - (id)init { - NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"AboutIPC" - ofType:@"nib"]; + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:@"AboutIPC" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { // Default to all on appCache_ = view_ = utilityHost_ = viewHost_ = plugin_ = diff --git a/chrome/browser/ui/cocoa/about_window_controller.mm b/chrome/browser/ui/cocoa/about_window_controller.mm index d7fdf94..5c95694 100644 --- a/chrome/browser/ui/cocoa/about_window_controller.mm +++ b/chrome/browser/ui/cocoa/about_window_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/about_window_controller.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" @@ -105,8 +106,8 @@ void AttributedStringAppendHyperlink(NSMutableAttributedString* attr_str, @implementation AboutWindowController - (id)initWithProfile:(Profile*)profile { - NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"About" - ofType:@"nib"]; + NSString* nibPath = [base::mac::FrameworkBundle() pathForResource:@"About" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { profile_ = profile; NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm index 8fad883..55265a2 100644 --- a/chrome/browser/ui/cocoa/base_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/base_bubble_controller.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/scoped_nsobject.h" #include "base/string_util.h" @@ -54,8 +55,8 @@ class Bridge : public content::NotificationObserver { - (id)initWithWindowNibPath:(NSString*)nibPath parentWindow:(NSWindow*)parentWindow anchoredAt:(NSPoint)anchoredAt { - nibPath = [base::mac::MainAppBundle() pathForResource:nibPath - ofType:@"nib"]; + nibPath = [base::mac::FrameworkBundle() pathForResource:nibPath + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentWindow_ = parentWindow; anchor_ = anchoredAt; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 1cf8ba0..0362fbe 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/metrics/histogram.h" #include "base/sys_string_conversions.h" @@ -233,7 +234,7 @@ void RecordAppLaunch(Profile* profile, GURL url) { delegate:(id<BookmarkBarControllerDelegate>)delegate resizeDelegate:(id<ViewResizer>)resizeDelegate { if ((self = [super initWithNibName:@"BookmarkBar" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { // Initialize to an invalid state. visualState_ = bookmarks::kInvalidState; lastVisualState_ = bookmarks::kInvalidState; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm index d210b58..8618a0f 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -230,8 +231,8 @@ struct LayoutMetrics { parentController:(BookmarkBarFolderController*)parentController barController:(BookmarkBarController*)barController { NSString* nibPath = - [base::mac::MainAppBundle() pathForResource:@"BookmarkBarFolderWindow" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"BookmarkBarFolderWindow" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentButton_.reset([button retain]); selectedIndex_ = -1; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm index 555ff190..61e51ac 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -91,8 +92,8 @@ void BookmarkBubbleNotificationBridge::Observe( node:(const BookmarkNode*)node alreadyBookmarked:(BOOL)alreadyBookmarked { NSString* nibPath = - [base::mac::MainAppBundle() pathForResource:@"BookmarkBubble" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"BookmarkBubble" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentWindow_ = parentWindow; model_ = model; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm index a79c7c6..264b8d6 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm @@ -8,6 +8,7 @@ #include "base/auto_reset.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -169,7 +170,7 @@ class BookmarkEditorBaseControllerBridge : public BookmarkModelObserver { profile:(Profile*)profile parent:(const BookmarkNode*)parent configuration:(BookmarkEditor::Configuration)configuration { - NSString* nibpath = [base::mac::MainAppBundle() + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:nibName ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm index 7bf3061..d7c736a 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -21,7 +22,7 @@ node:(const BookmarkNode*)node parent:(const BookmarkNode*)parent newIndex:(int)newIndex { - NSString* nibpath = [base::mac::MainAppBundle() + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:@"BookmarkNameFolder" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm index a74ebcc..e550e86 100644 --- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -320,7 +321,7 @@ const CGFloat kLabelInset = 49.0; - (id)initWithModelIndex:(size_t)modelIndex menuController:(AvatarMenuBubbleController*)controller { if ((self = [super initWithNibName:@"AvatarMenuItem" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { modelIndex_ = modelIndex; controller_ = controller; [self loadView]; diff --git a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm index c486e76..1fa63bf6 100644 --- a/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #import "base/mac/mac_util.h" #include "base/string16.h" #include "base/sys_string_conversions.h" @@ -33,7 +34,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) { delegate:(EditSearchEngineControllerDelegate*)delegate templateURL:(const TemplateURL*)url { DCHECK(profile); - NSString* nibpath = [base::mac::MainAppBundle() + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:@"EditSearchEngine" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 1536492..73f8979 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -8,6 +8,7 @@ #include <numeric> #include "base/command_line.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #import "base/memory/scoped_nsobject.h" #include "base/sys_string_conversions.h" @@ -215,7 +216,7 @@ enum { - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we // can override it in a unit test. - NSString* nibpath = [base::mac::MainAppBundle() + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:@"BrowserWindow" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm index df43493..582ab9b 100644 --- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm @@ -6,6 +6,7 @@ #include <vector> +#include "base/mac/bundle_locations.h" #import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/content_settings/cookie_settings.h" @@ -144,8 +145,8 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { DCHECK(wrapper); NSString* nibpath = - [base::mac::MainAppBundle() pathForResource:@"CollectedCookies" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"CollectedCookies" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { wrapper_ = wrapper; [self loadTreeModelFromTabContentsWrapper]; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.mm index 73e570f..45ec3ea 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/content_settings/cookie_details_view_controller.h" +#include "base/mac/bundle_locations.h" #import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h" @@ -22,7 +23,7 @@ static const int kExtraMarginBelowWhenExpirationEditable = 5; - (id)init { return [super initWithNibName:@"CookieDetailsView" - bundle:base::mac::MainAppBundle()]; + bundle:base::mac::FrameworkBundle()]; } - (void)awakeFromNib { diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index 29d0a99..22ab1e0 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/download/download_item_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/metrics/histogram.h" #include "base/string16.h" @@ -103,7 +104,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { - (id)initWithModel:(BaseDownloadItemModel*)downloadModel shelf:(DownloadShelfController*)shelf { if ((self = [super initWithNibName:@"DownloadItem" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { // Must be called before [self view], so that bridge_ is set in awakeFromNib bridge_.reset(new DownloadItemMac(downloadModel, self)); menuBridge_.reset(new DownloadShelfContextMenuMac(downloadModel)); diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm index 19b5a7a..f3c0fcc 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -90,7 +91,7 @@ const NSSize kHoverCloseButtonDefaultSize = { 16, 16 }; - (id)initWithBrowser:(Browser*)browser resizeDelegate:(id<ViewResizer>)resizeDelegate { if ((self = [super initWithNibName:@"DownloadShelf" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { resizeDelegate_ = resizeDelegate; maxShelfHeight_ = NSHeight([[self view] bounds]); currentShelfHeight_ = maxShelfHeight_; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm index 4d4aabe..445fc60 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/scoped_nsobject.h" #include "base/string_util.h" @@ -92,15 +93,15 @@ void AppendRatingStarsShim(const SkBitmap* skiaImage, void* data) { // warnings, that respectively show webstore ratings data and are a more // nicely laid out. if (prompt.type() == ExtensionInstallUI::INLINE_INSTALL_PROMPT) { - nibpath = [base::mac::MainAppBundle() + nibpath = [base::mac::FrameworkBundle() pathForResource:@"ExtensionInstallPromptInline" ofType:@"nib"]; } else if (prompt.GetPermissionCount() == 0) { - nibpath = [base::mac::MainAppBundle() + nibpath = [base::mac::FrameworkBundle() pathForResource:@"ExtensionInstallPromptNoWarnings" ofType:@"nib"]; } else { - nibpath = [base::mac::MainAppBundle() + nibpath = [base::mac::FrameworkBundle() pathForResource:@"ExtensionInstallPrompt" ofType:@"nib"]; } diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm index caf502bd..888b58c 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.h" #include "base/i18n/rtl.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -86,8 +87,8 @@ class ExtensionLoadedNotificationObserver browser:(Browser*)browser icon:(SkBitmap)icon { NSString* nibPath = - [base::mac::MainAppBundle() pathForResource:@"ExtensionInstalledBubble" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"ExtensionInstalledBubble" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { DCHECK(parentWindow); parentWindow_ = parentWindow; diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm index 71f4c8a..181d0a8 100644 --- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm @@ -4,6 +4,7 @@ #import <Cocoa/Cocoa.h> +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/ui/cocoa/browser_window_controller.h" @@ -60,7 +61,7 @@ const float kRightEdgeOffset = 25; - (id)init { if ((self = [super initWithNibName:@"FindBar" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(findPboardUpdated:) diff --git a/chrome/browser/ui/cocoa/first_run_dialog.mm b/chrome/browser/ui/cocoa/first_run_dialog.mm index 6bbbc8a..e7138f7 100644 --- a/chrome/browser/ui/cocoa/first_run_dialog.mm +++ b/chrome/browser/ui/cocoa/first_run_dialog.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/first_run_dialog.h" #include "base/bind.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/ref_counted.h" #import "base/memory/scoped_nsobject.h" @@ -168,8 +169,8 @@ void ShowFirstRunDialog(Profile* profile, - (id)init { NSString* nibpath = - [base::mac::MainAppBundle() pathForResource:@"FirstRunDialog" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"FirstRunDialog" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { // Bound to the dialog checkboxes. makeDefaultBrowser_ = ShellIntegration::CanSetAsDefaultBrowser(); diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm index 2cce8a3..dbd1815 100644 --- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm @@ -5,6 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" // for NOTREACHED() +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -68,8 +69,8 @@ const float kHideDuration = 0.7; url:(const GURL&)url bubbleType:(FullscreenExitBubbleType)bubbleType { NSString* nibPath = - [base::mac::MainAppBundle() pathForResource:@"FullscreenExitBubble" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"FullscreenExitBubble" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { browser_ = browser; owner_ = owner; diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index f445f32..aaa619a 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -6,6 +6,7 @@ #import <Cocoa/Cocoa.h> +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/process_util.h" #include "base/sys_string_conversions.h" @@ -65,8 +66,8 @@ class WebContentsObserverBridge : public content::WebContentsObserver { @implementation HungRendererController - (id)initWithWindowNibName:(NSString*)nibName { - NSString* nibpath = [base::mac::MainAppBundle() pathForResource:nibName - ofType:@"nib"]; + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:nibName + ofType:@"nib"]; self = [super initWithWindowNibPath:nibpath owner:self]; if (self) { [tableView_ setDataSource:self]; diff --git a/chrome/browser/ui/cocoa/importer/import_progress_dialog_cocoa.mm b/chrome/browser/ui/cocoa/importer/import_progress_dialog_cocoa.mm index 9d50236..64b69ea 100644 --- a/chrome/browser/ui/cocoa/importer/import_progress_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/importer/import_progress_dialog_cocoa.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/importer/import_progress_dialog_cocoa.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/message_loop.h" #import "base/memory/scoped_nsobject.h" @@ -59,8 +60,8 @@ NSString* keyForImportItem(importer::ImportItem item) { observer:(ImporterObserver*)observer itemsEnabled:(int16)items { NSString* nib_path = - [base::mac::MainAppBundle() pathForResource:@"ImportProgressDialog" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"ImportProgressDialog" + ofType:@"nib"]; self = [super initWithWindowNibPath:nib_path owner:self]; if (self != nil) { importer_host_ = host; diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm index 47789f4..7288784 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "chrome/browser/infobars/infobar.h" #include "chrome/browser/infobars/infobar_tab_helper.h" @@ -85,7 +86,7 @@ class InfoBarNotificationObserver : public content::NotificationObserver { - (id)initWithResizeDelegate:(id<ViewResizer>)resizeDelegate { DCHECK(resizeDelegate); if ((self = [super initWithNibName:@"InfoBarContainer" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { resizeDelegate_ = resizeDelegate; infoBarObserver_.reset(new InfoBarNotificationObserver(self)); diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm index c81a363..1704f8b 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm @@ -5,6 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" // for NOTREACHED() +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/infobars/infobar_tab_helper.h" @@ -53,7 +54,7 @@ const float kAnimateCloseDuration = 0.12; owner:(InfoBarTabHelper*)owner { DCHECK(delegate); if ((self = [super initWithNibName:@"InfoBar" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { delegate_ = delegate; owner_ = owner; } diff --git a/chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.mm b/chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.mm index 9750caf..22975e7 100644 --- a/chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.mm +++ b/chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.mm @@ -4,13 +4,14 @@ #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" @implementation InstantOptInController - (id)initWithDelegate:(InstantOptInControllerDelegate*)delegate { if ((self = [super initWithNibName:@"InstantOptIn" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { delegate_ = delegate; } return self; diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm index 6738f70..af197ea 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm @@ -4,6 +4,7 @@ #include "chrome/browser/ui/cocoa/notifications/balloon_controller.h" +#include "base/mac/bundle_locations.h" #import "base/mac/cocoa_protocols.h" #include "base/mac/mac_util.h" #import "base/memory/scoped_nsobject.h" @@ -45,8 +46,8 @@ const int kRightMargin = 2; - (id)initWithBalloon:(Balloon*)balloon { NSString* nibpath = - [base::mac::MainAppBundle() pathForResource:@"Notification" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"Notification" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { balloon_ = balloon; [self initializeHost]; diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm index 850b49c..3fb4359 100644 --- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm @@ -7,6 +7,7 @@ #include <algorithm> #include "base/bind.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/message_loop.h" #include "base/sys_string_conversions.h" @@ -72,8 +73,8 @@ void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() { - (id)init { NSString* nibpath = - [base::mac::MainAppBundle() pathForResource:@"SearchEngineDialog" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"SearchEngineDialog" + ofType:@"nib"]; self = [super initWithWindowNibPath:nibpath owner:self]; if (self != nil) { bridge_ = new SearchEngineDialogControllerBridge(self); diff --git a/chrome/browser/ui/cocoa/select_file_dialog_mac.mm b/chrome/browser/ui/cocoa/select_file_dialog_mac.mm index f3e7e6e..902034d 100644 --- a/chrome/browser/ui/cocoa/select_file_dialog_mac.mm +++ b/chrome/browser/ui/cocoa/select_file_dialog_mac.mm @@ -13,6 +13,7 @@ #include "base/file_util.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #import "base/mac/cocoa_protocols.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" @@ -295,7 +296,7 @@ NSView* SelectFileDialogImpl::GetAccessoryView(const FileTypeInfo* file_types, DCHECK(file_types); scoped_nsobject<NSNib> nib ( [[NSNib alloc] initWithNibNamed:@"SaveAccessoryView" - bundle:base::mac::MainAppBundle()]); + bundle:base::mac::FrameworkBundle()]); if (!nib) return nil; diff --git a/chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.mm index 1358012..f27b299 100644 --- a/chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "content/public/browser/web_contents.h" @@ -16,7 +17,7 @@ using content::WebContents; - (id)init { if ((self = [super initWithNibName:@"PreviewableContents" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { } return self; } diff --git a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm index 3a0a12e..6613361 100644 --- a/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm @@ -4,6 +4,7 @@ #include "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #import "chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h" @@ -25,7 +26,7 @@ gfx::NativeView GetViewOfSadTabController(SadTabController* sad_tab) { - (id)initWithWebContents:(WebContents*)webContents { if ((self = [super initWithNibName:@"SadTab" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { webContents_ = webContents; } diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_controller.mm index ead0eca..b97c697 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_controller.mm @@ -6,6 +6,7 @@ #include <cmath> +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #import "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/menu_controller.h" @@ -79,7 +80,7 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate { } - (id)init { - self = [super initWithNibName:@"TabView" bundle:base::mac::MainAppBundle()]; + self = [super initWithNibName:@"TabView" bundle:base::mac::FrameworkBundle()]; if (self != nil) { isIconShowing_ = YES; NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index e293396..5a3a629 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm @@ -7,6 +7,7 @@ #include <algorithm> #include <vector> +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -107,7 +108,7 @@ class SortHelper { - (id)initWithTaskManagerObserver:(TaskManagerMac*)taskManagerObserver highlightBackgroundResources:(bool)highlightBackgroundResources { - NSString* nibpath = [base::mac::MainAppBundle() + NSString* nibpath = [base::mac::FrameworkBundle() pathForResource:@"TaskManager" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm index e8331d2..d22fc28 100644 --- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm @@ -6,6 +6,7 @@ #include <algorithm> +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/singleton.h" #include "base/string_util.h" @@ -150,7 +151,7 @@ class NotificationBridge : public content::NotificationObserver { nibFileNamed:(NSString*)nibName { DCHECK(model && commands && profile && [nibName length]); if ((self = [super initWithNibName:nibName - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { toolbarModel_ = model; commands_ = commands; profile_ = profile; diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm index 2f4d872..2454a13 100644 --- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" #include "base/basictypes.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/string16.h" #include "base/sys_string_conversions.h" @@ -321,7 +322,7 @@ class ZoomLevelObserver : public content::NotificationObserver { - (id)initWithController:(WrenchMenuController*)controller { if ((self = [super initWithNibName:@"WrenchMenu" - bundle:base::mac::MainAppBundle()])) { + bundle:base::mac::FrameworkBundle()])) { controller_ = controller; } return self; diff --git a/chrome/browser/ui/login/login_prompt_mac.mm b/chrome/browser/ui/login/login_prompt_mac.mm index 31ea547..c0d5c0c 100644 --- a/chrome/browser/ui/login/login_prompt_mac.mm +++ b/chrome/browser/ui/login/login_prompt_mac.mm @@ -5,6 +5,7 @@ #include "chrome/browser/ui/login/login_prompt.h" #import "chrome/browser/ui/login/login_prompt_mac.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/string16.h" #include "base/string_util.h" @@ -135,8 +136,8 @@ LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, - (id)initWithLoginHandler:(LoginHandlerMac*)handler { NSString* nibPath = - [base::mac::MainAppBundle() pathForResource:@"HttpAuthLoginSheet" - ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"HttpAuthLoginSheet" + ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { handler_ = handler; diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm index c1ed457..70b9635c 100644 --- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm +++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm @@ -7,6 +7,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/time.h" @@ -73,7 +74,7 @@ enum { - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window { NSString* nibpath = - [base::mac::MainAppBundle() pathForResource:@"Panel" ofType:@"nib"]; + [base::mac::FrameworkBundle() pathForResource:@"Panel" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { windowShim_.reset(window); animateOnBoundsChange_ = YES; diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 6232b85..f72adfc 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/path_service.h" #include "base/string_util.h" #include "base/sys_info.h" @@ -172,7 +173,7 @@ bool PathProvider(int key, FilePath* result) { break; case chrome::DIR_RESOURCES: #if defined(OS_MACOSX) - cur = base::mac::MainAppBundlePath(); + cur = base::mac::FrameworkBundlePath(); cur = cur.Append(FILE_PATH_LITERAL("Resources")); #else if (!PathService::Get(chrome::DIR_APP, &cur)) @@ -216,7 +217,7 @@ bool PathProvider(int key, FilePath* result) { break; case chrome::DIR_MEDIA_LIBS: #if defined(OS_MACOSX) - *result = base::mac::MainAppBundlePath(); + *result = base::mac::FrameworkBundlePath(); *result = result->Append("Libraries"); return true; #else @@ -281,7 +282,7 @@ bool PathProvider(int key, FilePath* result) { case chrome::FILE_RESOURCES_PACK: #if defined(OS_MACOSX) if (base::mac::AmIBundled()) { - cur = base::mac::MainAppBundlePath(); + cur = base::mac::FrameworkBundlePath(); cur = cur.Append(FILE_PATH_LITERAL("Resources")) .Append(FILE_PATH_LITERAL("resources.pak")); break; @@ -409,7 +410,7 @@ bool PathProvider(int key, FilePath* result) { case chrome::DIR_DEFAULT_APPS: #if defined(OS_MACOSX) - cur = base::mac::MainAppBundlePath(); + cur = base::mac::FrameworkBundlePath(); cur = cur.Append(FILE_PATH_LITERAL("Default Apps")); #else if (!PathService::Get(chrome::DIR_APP, &cur)) diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm index 9df7cd5..f3783e0 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm @@ -53,7 +53,7 @@ const char* ProductDirNameInternal() { // in the main app's bundle because it will be set differently on the canary // channel, and the autoupdate system dictates that there can be no // differences between channels within the versioned directory. This would - // normally use base::mac::MainAppBundle(), but that references the + // normally use base::mac::FrameworkBundle(), but that references the // framework bundle within the versioned directory. Ordinarily, the profile // should not be accessed from non-browser processes, but those processes do // attempt to get the profile directory, so direct them to look in the outer diff --git a/chrome/common/service_process_util_mac.mm b/chrome/common/service_process_util_mac.mm index 383f26f..1345788 100644 --- a/chrome/common/service_process_util_mac.mm +++ b/chrome/common/service_process_util_mac.mm @@ -12,6 +12,7 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" @@ -36,7 +37,7 @@ namespace { CFStringRef CopyServiceProcessLaunchDName() { base::mac::ScopedNSAutoreleasePool pool; - NSBundle* bundle = base::mac::MainAppBundle(); + NSBundle* bundle = base::mac::FrameworkBundle(); return CFStringCreateCopy(kCFAllocatorDefault, base::mac::NSToCFCast([bundle bundleIdentifier])); } diff --git a/ui/base/resource/resource_bundle_mac.mm b/ui/base/resource/resource_bundle_mac.mm index e15962b..1fb7bd6 100644 --- a/ui/base/resource/resource_bundle_mac.mm +++ b/ui/base/resource/resource_bundle_mac.mm @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "base/file_path.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/memory/scoped_nsobject.h" #include "base/synchronization/lock.h" @@ -25,13 +26,13 @@ FilePath GetResourcesPakFilePath(NSString* name, NSString* mac_locale) { // as the already-running browser instead of using what NSBundle might pick // based on values at helper launch time. if ([mac_locale length]) { - resource_path = [base::mac::MainAppBundle() pathForResource:name - ofType:@"pak" - inDirectory:@"" - forLocalization:mac_locale]; + resource_path = [base::mac::FrameworkBundle() pathForResource:name + ofType:@"pak" + inDirectory:@"" + forLocalization:mac_locale]; } else { - resource_path = [base::mac::MainAppBundle() pathForResource:name - ofType:@"pak"]; + resource_path = [base::mac::FrameworkBundle() pathForResource:name + ofType:@"pak"]; } if (!resource_path) return FilePath(); diff --git a/ui/gfx/mac/nsimage_cache.h b/ui/gfx/mac/nsimage_cache.h index 64c1896..bb662d0 100644 --- a/ui/gfx/mac/nsimage_cache.h +++ b/ui/gfx/mac/nsimage_cache.h @@ -18,8 +18,8 @@ class NSString; namespace gfx { -// Returns an autoreleased image from the main app bundle -// (mac_util::MainAppBundle()) with the given name, and keeps it in memory so +// Returns an autoreleased image from the framework bundle +// (base::mac::FrameworkBundle()) with the given name, and keeps it in memory so // future fetches are fast. // NOTE: // - This should only be called on the main thread. diff --git a/ui/gfx/mac/nsimage_cache.mm b/ui/gfx/mac/nsimage_cache.mm index e7bb6e3..997a548 100644 --- a/ui/gfx/mac/nsimage_cache.mm +++ b/ui/gfx/mac/nsimage_cache.mm @@ -7,6 +7,7 @@ #import <AppKit/AppKit.h> #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" // When C++ exceptions are disabled, the C++ library defines |try| and @@ -38,7 +39,7 @@ NSImage* GetCachedImageWithName(NSString* name) { DVLOG_IF(1, [[name pathExtension] length] == 0) << "Suggest including the " "extension in the image name"; - NSString* path = [base::mac::MainAppBundle() pathForImageResource:name]; + NSString* path = [base::mac::FrameworkBundle() pathForImageResource:name]; if (path) { @try { result = [[[NSImage alloc] initWithContentsOfFile:path] autorelease]; diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index 9b40c16..cc6fedf 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -11,6 +11,7 @@ #include "base/base_paths.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/mac_util.h" #include "base/path_service.h" #include "base/string16.h" @@ -106,8 +107,8 @@ void AfterInitialize(bool unit_test_mode) { // Load a data pack. g_resource_data_pack = new ui::DataPack; NSString* resource_path = - [base::mac::MainAppBundle() pathForResource:@"DumpRenderTree" - ofType:@"pak"]; + [base::mac::FrameworkBundle() pathForResource:@"DumpRenderTree" + ofType:@"pak"]; FilePath resources_pak_path([resource_path fileSystemRepresentation]); if (!g_resource_data_pack->Load(resources_pak_path)) { LOG(FATAL) << "failed to load DumpRenderTree.pak"; diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 2aa62b0..835ff4f 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -15,6 +15,7 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" +#include "base/mac/bundle_locations.h" #include "base/mac/cocoa_protocols.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" @@ -213,8 +214,8 @@ void TestShell::InitializeTestShell(bool layout_test_mode, // tests. This is a harmless failure for test_shell_tests. g_resource_data_pack = new ui::DataPack; NSString *resource_path = - [base::mac::MainAppBundle() pathForResource:@"test_shell" - ofType:@"pak"]; + [base::mac::FrameworkBundle() pathForResource:@"test_shell" + ofType:@"pak"]; FilePath resources_pak_path([resource_path fileSystemRepresentation]); if (!g_resource_data_pack->Load(resources_pak_path)) { LOG(FATAL) << "failed to load test_shell.pak"; @@ -224,7 +225,7 @@ void TestShell::InitializeTestShell(bool layout_test_mode, // Load the Ahem font, which is used by layout tests. const char* ahem_path_c; - NSString* ahem_path = [[base::mac::MainAppBundle() resourcePath] + NSString* ahem_path = [[base::mac::FrameworkBundle() resourcePath] stringByAppendingPathComponent:@"AHEM____.TTF"]; ahem_path_c = [ahem_path fileSystemRepresentation]; FSRef ahem_fsref; |