diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 18:20:14 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 18:20:14 +0000 |
commit | 0378bf4edc40686bac06c8e14bd25fdb3f9cfb28 (patch) | |
tree | ee5543b43dd9743d75e1aa8f16692dcfca6c813f /chrome | |
parent | d028296ec1c0fdfbd40e2390ca3121de7055295d (diff) | |
download | chromium_src-0378bf4edc40686bac06c8e14bd25fdb3f9cfb28.zip chromium_src-0378bf4edc40686bac06c8e14bd25fdb3f9cfb28.tar.gz chromium_src-0378bf4edc40686bac06c8e14bd25fdb3f9cfb28.tar.bz2 |
Move base/mac_util.h to base/mac and use the base::mac namespace.
Fix up callers to use the new location & namespace. Remove includes from
files where it wasn't necessary.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6046009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
100 files changed, 251 insertions, 260 deletions
diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index de14e92..caa46cc 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -13,7 +13,7 @@ #include "base/file_path.h" #include "base/file_util.h" #import "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #import "base/mac/scoped_nsautorelease_pool.h" #include "base/path_service.h" @@ -55,8 +55,8 @@ 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 = mac_util::MainAppBundle(); - bool is_browser = !mac_util::IsBackgroundOnlyProcess(); + NSBundle* main_bundle = base::mac::MainAppBundle(); + bool is_browser = !base::mac::IsBackgroundOnlyProcess(); bool enable_breakpad = false; CommandLine* command_line = CommandLine::ForCurrentProcess(); diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index e916f95..56e8981 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -48,8 +48,8 @@ #if defined(OS_MACOSX) #include "app/l10n_util_mac.h" +#include "base/mac/mac_util.h" #include "base/mac/os_crash_dumps.h" -#include "base/mac_util.h" #include "base/mach_ipc_mac.h" #include "chrome/app/breakpad_mac.h" #include "chrome/browser/mach_broker_mac.h" @@ -411,7 +411,7 @@ void SetMacProcessName(const std::string& process_type) { } if (name_id) { NSString* app_name = l10n_util::GetNSString(name_id); - mac_util::SetProcessName(reinterpret_cast<CFStringRef>(app_name)); + base::mac::SetProcessName(reinterpret_cast<CFStringRef>(app_name)); } } @@ -641,7 +641,7 @@ int ChromeMain(int argc, char** argv) { command_line.GetSwitchValueASCII(switches::kProcessType); #if defined(OS_MACOSX) - mac_util::SetOverrideAppBundlePath(chrome::GetFrameworkBundlePath()); + base::mac::SetOverrideAppBundlePath(chrome::GetFrameworkBundlePath()); #endif // OS_MACOSX // If we are in diagnostics mode this is the end of the line. After the @@ -747,7 +747,7 @@ int ChromeMain(int argc, char** argv) { // Browser process in release mode. if (!command_line.HasSwitch(switches::kDisableBreakpad)) { bool disable_apple_crash_reporter = is_debug_build - || mac_util::IsBackgroundOnlyProcess(); + || base::mac::IsBackgroundOnlyProcess(); if (!IsCrashReporterEnabled() && disable_apple_crash_reporter) { base::mac::DisableOSCrashDumps(); } @@ -760,11 +760,11 @@ int ChromeMain(int argc, char** argv) { // the helper should always have a --type switch. // // This check is done this late so there is already a call to - // mac_util::IsBackgroundOnlyProcess(), so there is no change in + // base::mac::IsBackgroundOnlyProcess(), so there is no change in // startup/initialization order. // The helper's Info.plist marks it as a background only app. - if (mac_util::IsBackgroundOnlyProcess()) { + if (base::mac::IsBackgroundOnlyProcess()) { CHECK(command_line.HasSwitch(switches::kProcessType)) << "Helper application requires --type."; } else { diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 428f375..2156f19 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -9,7 +9,7 @@ #include "base/auto_reset.h" #include "base/command_line.h" #include "base/file_path.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/message_loop.h" #include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" @@ -995,7 +995,7 @@ void RecordLastRunAppBundlePath() { static BOOL doneOnce = NO; if (!doneOnce) { doneOnce = YES; - if (mac_util::WasLaunchedAsHiddenLoginItem()) { + if (base::mac::WasLaunchedAsHiddenLoginItem()) { SessionService* sessionService = [self defaultProfile]->GetSessionService(); if (sessionService && diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 950cf08..d0b84e7 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -8,7 +8,6 @@ #include "app/resource_bundle.h" #include "app/text_elider.h" -#include "base/mac_util.h" #include "base/stl_util-inl.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 89ed06c..b0f3cbd 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -13,9 +13,6 @@ #include "chrome/browser/history/history.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_MACOSX) -#include "base/mac_util.h" -#endif using base::Time; using base::TimeDelta; diff --git a/chrome/browser/autofill/autofill_address_sheet_controller_mac.mm b/chrome/browser/autofill/autofill_address_sheet_controller_mac.mm index 80f0aac..d2f6938 100644 --- a/chrome/browser/autofill/autofill_address_sheet_controller_mac.mm +++ b/chrome/browser/autofill/autofill_address_sheet_controller_mac.mm @@ -5,7 +5,7 @@ #import "chrome/browser/autofill/autofill_address_sheet_controller_mac.h" #include "app/l10n_util.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #import "chrome/browser/autofill/autofill_address_model_mac.h" #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" @@ -18,7 +18,7 @@ - (id)initWithProfile:(const AutoFillProfile&)profile mode:(AutoFillAddressMode)mode { - NSString* nibPath = [mac_util::MainAppBundle() + NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"AutoFillAddressSheet" ofType:@"nib"]; self = [super initWithWindowNibPath:nibPath owner:self]; diff --git a/chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.mm b/chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.mm index 95eb140..ae72117 100644 --- a/chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.mm +++ b/chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.mm @@ -5,7 +5,7 @@ #import "chrome/browser/autofill/autofill_credit_card_sheet_controller_mac.h" #include "app/l10n_util.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" @@ -33,7 +33,7 @@ - (id)initWithCreditCard:(const CreditCard&)creditCard mode:(AutoFillCreditCardMode)mode { - NSString* nibPath = [mac_util::MainAppBundle() + NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"AutoFillCreditCardSheet" ofType:@"nib"]; self = [super initWithWindowNibPath:nibPath owner:self]; diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.mm b/chrome/browser/autofill/autofill_dialog_controller_mac.mm index 713c172..892160f 100644 --- a/chrome/browser/autofill/autofill_dialog_controller_mac.mm +++ b/chrome/browser/autofill/autofill_dialog_controller_mac.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/lazy_instance.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #import "chrome/browser/autofill/autofill_address_model_mac.h" #import "chrome/browser/autofill/autofill_address_sheet_controller_mac.h" @@ -664,7 +664,7 @@ class PreferenceObserver : public NotificationObserver { DCHECK(profile); // Use initWithWindowNibPath: instead of initWithWindowNibName: so we // can override it in a unit test. - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"AutoFillDialog" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/background_mode_manager_mac.mm b/chrome/browser/background_mode_manager_mac.mm index cc6ab4b..40b958d 100644 --- a/chrome/browser/background_mode_manager_mac.mm +++ b/chrome/browser/background_mode_manager_mac.mm @@ -4,7 +4,7 @@ #include "app/l10n_util.h" #include "base/command_line.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/background_mode_manager.h" #include "chrome/browser/browser_thread.h" #include "chrome/common/app_mode_common_mac.h" @@ -40,18 +40,18 @@ void DisableLaunchOnStartupTask::Run() { // Check if Chrome is not a login Item, or is a Login Item but w/o 'hidden' // flag - most likely user has modified the setting, don't override it. bool is_hidden = false; - if (!mac_util::CheckLoginItemStatus(&is_hidden) || !is_hidden) + if (!base::mac::CheckLoginItemStatus(&is_hidden) || !is_hidden) return; - mac_util::RemoveFromLoginItems(); + base::mac::RemoveFromLoginItems(); } void EnableLaunchOnStartupTask::Run() { // Return if Chrome is already a Login Item (avoid overriding user choice). - if (mac_util::CheckLoginItemStatus(NULL)) + if (base::mac::CheckLoginItemStatus(NULL)) return; - mac_util::AddToLoginItems(true); // Hide on startup. + base::mac::AddToLoginItems(true); // Hide on startup. CFPreferencesSetAppValue(kLaunchOnStartupResetAllowedPrefsKey, kCFBooleanTrue, app_mode::kAppPrefsID); diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm index 619be2d..fa88bc8 100644 --- a/chrome/browser/browser_main_mac.mm +++ b/chrome/browser/browser_main_mac.mm @@ -12,7 +12,7 @@ #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/file_path.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/nss_util.h" #include "base/path_service.h" #include "base/scoped_nsobject.h" @@ -70,7 +70,7 @@ class BrowserMainPartsMac : public BrowserMainPartsPosix { virtual void PreEarlyInitialization() { BrowserMainPartsPosix::PreEarlyInitialization(); - if (mac_util::WasLaunchedAsHiddenLoginItem()) { + if (base::mac::WasLaunchedAsHiddenLoginItem()) { CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); singleton_command_line->AppendSwitch(switches::kNoStartupWindow); } @@ -113,7 +113,7 @@ class BrowserMainPartsMac : public BrowserMainPartsPosix { // Now load the nib (from the right bundle). scoped_nsobject<NSNib> nib([[NSNib alloc] initWithNibNamed:@"MainMenu" - bundle:mac_util::MainAppBundle()]); + bundle:base::mac::MainAppBundle()]); // 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/bug_report_util.h b/chrome/browser/bug_report_util.h index 61835d6..3bb9ee3 100644 --- a/chrome/browser/bug_report_util.h +++ b/chrome/browser/bug_report_util.h @@ -9,18 +9,16 @@ #include <string> #include "base/basictypes.h" -#if defined(OS_MACOSX) -#include "base/mac_util.h" -#include "base/sys_info.h" -#elif defined(OS_WIN) -#include "base/win/windows_version.h" -#endif #include "chrome/browser/userfeedback/proto/common.pb.h" #include "chrome/browser/userfeedback/proto/extension.pb.h" #include "chrome/browser/userfeedback/proto/math.pb.h" #include "gfx/rect.h" -#if defined(OS_CHROMEOS) +#if defined(OS_MACOSX) +#include "base/sys_info.h" +#elif defined(OS_WIN) +#include "base/win/windows_version.h" +#elif defined(OS_CHROMEOS) #include "chrome/browser/chromeos/cros/syslogs_library.h" #include "chrome/browser/chromeos/cros/cros_library.h" #endif diff --git a/chrome/browser/dom_ui/bug_report_ui.cc b/chrome/browser/dom_ui/bug_report_ui.cc index 1583243..654c48c 100644 --- a/chrome/browser/dom_ui/bug_report_ui.cc +++ b/chrome/browser/dom_ui/bug_report_ui.cc @@ -39,7 +39,7 @@ #if defined(USE_X11) #include "app/x11_util.h" #elif defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #elif defined(OS_WIN) #include "app/win/win_util.h" #endif @@ -173,7 +173,7 @@ void RefreshLastScreenshot(NSWindow* window) { #if defined(USE_X11) x11_util::GrabWindowSnapshot(window, last_screenshot_png); #elif defined(OS_MACOSX) - mac_util::GrabWindowSnapshot(window, last_screenshot_png, &width, &height); + base::mac::GrabWindowSnapshot(window, last_screenshot_png, &width, &height); #elif defined(OS_WIN) app::win::GrabWindowSnapshot(window, last_screenshot_png); #endif diff --git a/chrome/browser/history/history_database.cc b/chrome/browser/history/history_database.cc index f0c546c..c5478b8 100644 --- a/chrome/browser/history/history_database.cc +++ b/chrome/browser/history/history_database.cc @@ -17,7 +17,7 @@ #include "chrome/common/chrome_switches.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif namespace history { @@ -99,11 +99,11 @@ sql::InitStatus HistoryDatabase::Init(const FilePath& history_name, #if defined(OS_MACOSX) // Exclude the history file and its journal from backups. - mac_util::SetFileBackupExclusion(history_name, true); + base::mac::SetFileBackupExclusion(history_name, true); FilePath::StringType history_name_string(history_name.value()); history_name_string += "-journal"; FilePath history_journal_name(history_name_string); - mac_util::SetFileBackupExclusion(history_journal_name, true); + base::mac::SetFileBackupExclusion(history_journal_name, true); #endif // Prime the cache. diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index e1054ac..7fa8bd1 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -22,7 +22,7 @@ #include "third_party/skia/include/core/SkBitmap.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif namespace history { @@ -53,11 +53,11 @@ sql::InitStatus ThumbnailDatabase::Init( #if defined(OS_MACOSX) // Exclude the thumbnails file and its journal from backups. - mac_util::SetFileBackupExclusion(db_name, true); + base::mac::SetFileBackupExclusion(db_name, true); FilePath::StringType db_name_string(db_name.value()); db_name_string += "-journal"; FilePath db_journal_name(db_name_string); - mac_util::SetFileBackupExclusion(db_journal_name, true); + base::mac::SetFileBackupExclusion(db_journal_name, true); #endif // Create the tables. diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc index 5579725..ce3f316 100644 --- a/chrome/browser/importer/importer_list.cc +++ b/chrome/browser/importer/importer_list.cc @@ -23,7 +23,7 @@ #include "chrome/browser/password_manager/ie7_password.h" #endif #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/importer/safari_importer.h" #endif @@ -46,7 +46,7 @@ void DetectIEProfiles(std::vector<importer::ProfileInfo*>* profiles) { #if defined(OS_MACOSX) void DetectSafariProfiles(std::vector<importer::ProfileInfo*>* profiles) { uint16 items = importer::NONE; - if (!SafariImporter::CanImport(mac_util::GetUserLibraryPath(), &items)) + if (!SafariImporter::CanImport(base::mac::GetUserLibraryPath(), &items)) return; importer::ProfileInfo* safari = new importer::ProfileInfo(); @@ -133,7 +133,7 @@ Importer* ImporterList::CreateImporterByType(importer::ProfileType type) { return new Toolbar5Importer(); #if defined(OS_MACOSX) case importer::SAFARI: - return new SafariImporter(mac_util::GetUserLibraryPath()); + return new SafariImporter(base::mac::GetUserLibraryPath()); #endif // OS_MACOSX case importer::NO_PROFILE_TYPE: NOTREACHED(); diff --git a/chrome/browser/memory_details_mac.cc b/chrome/browser/memory_details_mac.cc index 2ecac8d..fbc4d98 100644 --- a/chrome/browser/memory_details_mac.cc +++ b/chrome/browser/memory_details_mac.cc @@ -11,7 +11,7 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/file_version_info.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/string_util.h" #include "base/process_util.h" #include "base/threading/thread.h" @@ -146,7 +146,7 @@ void MemoryDetails::CollectProcessData( if (process_info.GetProcInfo(info.pid, &proc_info)) { if (proc_info.command.length() > 1 && proc_info.command[0] == '/') { FilePath bundle_name = - mac_util::GetAppBundlePath(FilePath(proc_info.command)); + base::mac::GetAppBundlePath(FilePath(proc_info.command)); if (!bundle_name.empty()) { version_info.reset(FileVersionInfo::CreateFileVersionInfo( bundle_name)); diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc index 750c45b..471962e 100644 --- a/chrome/browser/page_info_model.cc +++ b/chrome/browser/page_info_model.cc @@ -26,7 +26,7 @@ #include "net/base/x509_certificate.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif PageInfoModel::PageInfoModel(Profile* profile, @@ -277,7 +277,7 @@ PageInfoModel::~PageInfoModel() { // Release the NSImages. for (std::vector<gfx::NativeImage>::iterator it = icons_.begin(); it != icons_.end(); ++it) { - mac_util::NSObjectRelease(*it); + base::mac::NSObjectRelease(*it); } #endif } @@ -355,7 +355,7 @@ gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) { #if defined(OS_MACOSX) // Unlike other platforms, the Mac ResourceBundle does not keep a shared image // cache. These are released in the dtor. - mac_util::NSObjectRetain(image); + base::mac::NSObjectRetain(image); #endif return image; } diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index f45200a..abdb9c7 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -11,7 +11,7 @@ #include <vector> #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/message_loop.h" #include "base/stl_util-inl.h" #include "base/string_util.h" @@ -565,7 +565,8 @@ bool MacKeychainPasswordFormAdapter::AddPassword(const PasswordForm& form) { password.size(), password.c_str(), &new_item); if (result == noErr) { - SetKeychainItemCreatorCode(new_item, mac_util::CreatorCodeForApplication()); + SetKeychainItemCreatorCode(new_item, + base::mac::CreatorCodeForApplication()); keychain_->Free(new_item); } else if (result == errSecDuplicateItem) { // If we collide with an existing item, find and update it instead. @@ -722,7 +723,7 @@ bool MacKeychainPasswordFormAdapter::SetKeychainItemCreatorCode( } OSType MacKeychainPasswordFormAdapter::CreatorCodeForSearch() { - return finds_only_owned_ ? mac_util::CreatorCodeForApplication() : 0; + return finds_only_owned_ ? base::mac::CreatorCodeForApplication() : 0; } #pragma mark - diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm index 719183d..5306598 100644 --- a/chrome/browser/platform_util_mac.mm +++ b/chrome/browser/platform_util_mac.mm @@ -4,6 +4,7 @@ #include "chrome/browser/platform_util.h" +#include <Carbon/Carbon.h> #import <Cocoa/Cocoa.h> #import <CoreServices/CoreServices.h> @@ -11,7 +12,6 @@ #include "app/l10n_util_mac.h" #include "base/file_path.h" #include "base/logging.h" -#include "base/mac_util.h" #include "base/mac/scoped_aedesc.h" #include "base/sys_string_conversions.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index cb99a80..7bbb5a7 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -48,7 +48,7 @@ #endif #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/common/plugin_carbon_interpose_constants_mac.h" #include "gfx/rect.h" #endif @@ -148,22 +148,22 @@ PluginProcessHost::~PluginProcessHost() { window_index != plugin_fullscreen_windows_set_.end(); window_index++) { if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { - mac_util::ReleaseFullScreen(mac_util::kFullScreenModeHideAll); + base::mac::ReleaseFullScreen(base::mac::kFullScreenModeHideAll); } else { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::ReleaseFullScreen, - mac_util::kFullScreenModeHideAll)); + NewRunnableFunction(base::mac::ReleaseFullScreen, + base::mac::kFullScreenModeHideAll)); } } // If the plugin hid the cursor, reset that. if (!plugin_cursor_visible_) { if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { - mac_util::SetCursorVisibility(true); + base::mac::SetCursorVisibility(true); } else { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::SetCursorVisibility, + NewRunnableFunction(base::mac::SetCursorVisibility, true)); } } diff --git a/chrome/browser/plugin_process_host_mac.cc b/chrome/browser/plugin_process_host_mac.cc index cf05894..d976369 100644 --- a/chrome/browser/plugin_process_host_mac.cc +++ b/chrome/browser/plugin_process_host_mac.cc @@ -9,7 +9,7 @@ #include <vector> #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/plugin_process_host.h" #include "chrome/common/plugin_messages.h" @@ -44,8 +44,8 @@ void PluginProcessHost::OnPluginShowWindow(uint32 window_id, // otherwise our refcounting can get skewed). BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::RequestFullScreen, - mac_util::kFullScreenModeHideAll)); + NewRunnableFunction(base::mac::RequestFullScreen, + base::mac::kFullScreenModeHideAll)); } } @@ -55,10 +55,10 @@ void PluginProcessHost::OnPluginShowWindow(uint32 window_id, static void ReleasePluginFullScreen(pid_t plugin_pid) { // Releasing full screen only works if we are the frontmost process; grab // focus, but give it back to the plugin process if requested. - mac_util::ActivateProcess(base::GetCurrentProcId()); - mac_util::ReleaseFullScreen(mac_util::kFullScreenModeHideAll); + base::mac::ActivateProcess(base::GetCurrentProcId()); + base::mac::ReleaseFullScreen(base::mac::kFullScreenModeHideAll); if (plugin_pid != -1) { - mac_util::ActivateProcess(plugin_pid); + base::mac::ActivateProcess(plugin_pid); } } @@ -83,7 +83,7 @@ void PluginProcessHost::OnPluginHideWindow(uint32 window_id, if (browser_needs_activation) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::ActivateProcess, + NewRunnableFunction(base::mac::ActivateProcess, base::GetCurrentProcId())); } } @@ -96,7 +96,7 @@ void PluginProcessHost::OnAppActivation() { if (!plugin_modal_windows_set_.empty()) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::ActivateProcess, handle())); + NewRunnableFunction(base::mac::ActivateProcess, handle())); } } @@ -105,7 +105,7 @@ void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) { plugin_cursor_visible_ = visible; BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - NewRunnableFunction(mac_util::SetCursorVisibility, + NewRunnableFunction(base::mac::SetCursorVisibility, visible)); } } diff --git a/chrome/browser/renderer_host/backing_store_mac.mm b/chrome/browser/renderer_host/backing_store_mac.mm index 5754839..ede4d19 100644 --- a/chrome/browser/renderer_host/backing_store_mac.mm +++ b/chrome/browser/renderer_host/backing_store_mac.mm @@ -8,7 +8,7 @@ #include "app/surface/transport_dib.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/sys_info.h" #include "chrome/browser/renderer_host/render_process_host.h" @@ -69,7 +69,7 @@ void BackingStoreMac::PaintToBackingStore( base::mac::ScopedCFTypeRef<CGImageRef> bitmap_image( CGImageCreate(bitmap_rect.width(), bitmap_rect.height(), 8, 32, - 4 * bitmap_rect.width(), mac_util::GetSystemColorSpace(), + 4 * bitmap_rect.width(), base::mac::GetSystemColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, data_provider, NULL, false, kCGRenderingIntentDefault)); @@ -233,7 +233,7 @@ CGContextRef BackingStoreMac::CreateCGBitmapContext() { CGContextRef context = CGBitmapContextCreate(NULL, size().width(), size().height(), 8, size().width() * 4, - mac_util::GetSystemColorSpace(), + base::mac::GetSystemColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); DCHECK(context); diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm index 035507b..15258a9 100644 --- a/chrome/browser/shell_integration_mac.mm +++ b/chrome/browser/shell_integration_mac.mm @@ -4,13 +4,13 @@ #include "chrome/browser/shell_integration.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "third_party/mozilla/NSWorkspace+Utils.h" // Sets Chromium as default browser (only for current user). Returns false if // this operation fails (which we can't check for). bool ShellIntegration::SetAsDefaultBrowser() { - // We really do want the main bundle here, not mac_util::MainAppBundle(), + // We really do want the main bundle here, not base::mac::MainAppBundle(), // which is the bundle for the framework. NSString* identifier = [[NSBundle mainBundle] bundleIdentifier]; [[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:identifier]; diff --git a/chrome/browser/ui/cocoa/about_ipc_controller.mm b/chrome/browser/ui/cocoa/about_ipc_controller.mm index f7f7c31..89e0db7 100644 --- a/chrome/browser/ui/cocoa/about_ipc_controller.mm +++ b/chrome/browser/ui/cocoa/about_ipc_controller.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/time.h" @@ -86,7 +86,7 @@ AboutIPCController* gSharedController = nil; } - (id)init { - NSString* nibpath = [mac_util::MainAppBundle() pathForResource:@"AboutIPC" + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"AboutIPC" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { // Default to all on diff --git a/chrome/browser/ui/cocoa/about_window_controller.mm b/chrome/browser/ui/cocoa/about_window_controller.mm index f6da6ab..d87b5c1 100644 --- a/chrome/browser/ui/cocoa/about_window_controller.mm +++ b/chrome/browser/ui/cocoa/about_window_controller.mm @@ -8,7 +8,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" @@ -100,7 +100,7 @@ void AttributedStringAppendHyperlink(NSMutableAttributedString* attr_str, @implementation AboutWindowController - (id)initWithProfile:(Profile*)profile { - NSString* nibPath = [mac_util::MainAppBundle() pathForResource:@"About" + NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"About" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { profile_ = profile; @@ -128,7 +128,7 @@ void AttributedStringAppendHyperlink(NSMutableAttributedString* attr_str, static BOOL recentShownUserActionFailedStatus = NO; - (void)awakeFromNib { - NSBundle* bundle = mac_util::MainAppBundle(); + NSBundle* bundle = base::mac::MainAppBundle(); NSString* chromeVersion = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; diff --git a/chrome/browser/ui/cocoa/animatable_image.mm b/chrome/browser/ui/cocoa/animatable_image.mm index a73f5a4..2d09bf0 100644 --- a/chrome/browser/ui/cocoa/animatable_image.mm +++ b/chrome/browser/ui/cocoa/animatable_image.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/animatable_image.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" @@ -131,7 +131,7 @@ // rasterize PDF resources. - (void)setLayerContents:(CALayer*)layer { base::mac::ScopedCFTypeRef<CGImageRef> image( - mac_util::CopyNSImageToCGImage(image_.get())); + base::mac::CopyNSImageToCGImage(image_.get())); // Create the layer that will be animated. [layer setContents:(id)image.get()]; } diff --git a/chrome/browser/ui/cocoa/authorization_util.mm b/chrome/browser/ui/cocoa/authorization_util.mm index 5893711..9c434f3 100644 --- a/chrome/browser/ui/cocoa/authorization_util.mm +++ b/chrome/browser/ui/cocoa/authorization_util.mm @@ -12,7 +12,7 @@ #include "base/basictypes.h" #include "base/eintr_wrapper.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" #include "chrome/browser/ui/cocoa/scoped_authorizationref.h" @@ -41,14 +41,14 @@ 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 = - [mac_util::MainAppBundle() pathForResource:@"product_logo_32" + [base::mac::MainAppBundle() 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; // The OS will append " Type an administrator's name and password to allow // <CFBundleDisplayName> to make changes." - NSString* prompt_ns = mac_util::CFToNSCast(prompt); + NSString* prompt_ns = base::mac::CFToNSCast(prompt); const char* prompt_c = [prompt_ns UTF8String]; size_t prompt_length = prompt_c ? strlen(prompt_c) : 0; diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm index 3c1e9d2..768e9f1 100644 --- a/chrome/browser/ui/cocoa/base_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/scoped_nsobject.h" #include "base/string_util.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" @@ -54,7 +54,7 @@ class Bridge : public NotificationObserver { - (id)initWithWindowNibPath:(NSString*)nibPath parentWindow:(NSWindow*)parentWindow anchoredAt:(NSPoint)anchoredAt { - nibPath = [mac_util::MainAppBundle() pathForResource:nibPath + nibPath = [base::mac::MainAppBundle() pathForResource:nibPath ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentWindow_ = parentWindow; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index c08aae0..261c742 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_model.h" @@ -211,7 +211,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; delegate:(id<BookmarkBarControllerDelegate>)delegate resizeDelegate:(id<ViewResizer>)resizeDelegate { if ((self = [super initWithNibName:@"BookmarkBar" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { // 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 b86aab9..86420c2 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" #include "app/mac/nsimage_cache.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_utils.h" @@ -114,7 +114,7 @@ const CGFloat kScrollWindowVerticalMargin = 0.0; parentController:(BookmarkBarFolderController*)parentController barController:(BookmarkBarController*)barController { NSString* nibPath = - [mac_util::MainAppBundle() pathForResource:@"BookmarkBarFolderWindow" + [base::mac::MainAppBundle() pathForResource:@"BookmarkBarFolderWindow" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentButton_.reset([button retain]); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm index ae66081..82258da 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" // TODO(viettrungluu): remove #include "chrome/browser/bookmarks/bookmark_model.h" @@ -88,7 +88,7 @@ void BookmarkBubbleNotificationBridge::Observe( node:(const BookmarkNode*)node alreadyBookmarked:(BOOL)alreadyBookmarked { NSString* nibPath = - [mac_util::MainAppBundle() pathForResource:@"BookmarkBubble" + [base::mac::MainAppBundle() pathForResource:@"BookmarkBubble" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { parentWindow_ = parentWindow; 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 ffc9d69..8cce1b4 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm @@ -9,7 +9,7 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/profiles/profile.h" @@ -161,7 +161,7 @@ class BookmarkEditorBaseControllerBridge : public BookmarkModelObserver { profile:(Profile*)profile parent:(const BookmarkNode*)parent configuration:(BookmarkEditor::Configuration)configuration { - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() 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 b4f23d2..4db77eb 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h" @@ -20,7 +20,7 @@ node:(const BookmarkNode*)node parent:(const BookmarkNode*)parent newIndex:(int)newIndex { - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"BookmarkNameFolder" 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 589ed91..6240065 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -10,7 +10,7 @@ #include "app/l10n_util_mac.h" #include "app/mac/scoped_nsdisable_screen_updates.h" #include "app/mac/nsimage_cache.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" // IDC_* @@ -219,7 +219,7 @@ - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we // can override it in a unit test. - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"BrowserWindow" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm index 702c52b..98f1718 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" -#include "base/mac_util.h" #import "base/scoped_nsobject.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_service.h" diff --git a/chrome/browser/ui/cocoa/bug_report_window_controller.mm b/chrome/browser/ui/cocoa/bug_report_window_controller.mm index 82b3a36..5ea378a 100644 --- a/chrome/browser/ui/cocoa/bug_report_window_controller.mm +++ b/chrome/browser/ui/cocoa/bug_report_window_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/bug_report_window_controller.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/bug_report_util.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -26,7 +26,7 @@ - (id)initWithTabContents:(TabContents*)currentTab profile:(Profile*)profile { - NSString* nibpath = [mac_util::MainAppBundle() pathForResource:@"ReportBug" + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"ReportBug" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { currentTab_ = currentTab; @@ -62,7 +62,7 @@ [self setPageURL:base::SysUTF8ToNSString( currentTab_->controller().GetActiveEntry()->url().spec())]; [self setPageTitle:base::SysUTF16ToNSString(currentTab_->GetTitle())]; - mac_util::GrabWindowSnapshot( + base::mac::GrabWindowSnapshot( currentTab_->view()->GetTopLevelNativeWindow(), &pngData_, &pngWidth_, &pngHeight_); } else { diff --git a/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm b/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm index 9cbb8e0..f2fd657 100644 --- a/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm +++ b/chrome/browser/ui/cocoa/chrome_event_processing_window_unittest.mm @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <Carbon/Carbon.h> + #include "base/debug/debugger.h" #include "base/scoped_nsobject.h" #include "chrome/app/chrome_command_ids.h" diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm index c0c927e..0ced443 100644 --- a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm +++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "base/lazy_instance.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/scoped_nsobject.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/prefs/pref_service.h" @@ -98,7 +98,7 @@ static base::LazyInstance<ProfileControllerMap> g_profile_controller_map( DCHECK(profile); // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we // can override it in a unit test. - NSString *nibpath = [mac_util::MainAppBundle() + NSString *nibpath = [base::mac::MainAppBundle() pathForResource:@"ClearBrowsingData" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/cocoa_test_helper.h b/chrome/browser/ui/cocoa/cocoa_test_helper.h index f6c9bb8..d7eb150 100644 --- a/chrome/browser/ui/cocoa/cocoa_test_helper.h +++ b/chrome/browser/ui/cocoa/cocoa_test_helper.h @@ -8,7 +8,6 @@ #import <Cocoa/Cocoa.h> -#include "base/mac_util.h" #include "base/path_service.h" #import "base/mac/scoped_nsautorelease_pool.h" #import "base/scoped_nsobject.h" diff --git a/chrome/browser/ui/cocoa/cocoa_test_helper.mm b/chrome/browser/ui/cocoa/cocoa_test_helper.mm index 2cd2cc0..b4c68d9 100644 --- a/chrome/browser/ui/cocoa/cocoa_test_helper.mm +++ b/chrome/browser/ui/cocoa/cocoa_test_helper.mm @@ -6,6 +6,7 @@ #include "base/debug/debugger.h" #include "base/logging.h" +#include "base/mac/mac_util.h" #include "base/test/test_timeouts.h" #import "chrome/browser/chrome_browser_application_mac.h" @@ -79,7 +80,7 @@ void CocoaTest::BootstrapCocoa() { FilePath path; PathService::Get(base::DIR_EXE, &path); path = path.Append(chrome::kFrameworkName); - mac_util::SetOverrideAppBundlePath(path); + base::mac::SetOverrideAppBundlePath(path); // Bootstrap Cocoa. It's very unhappy without this. [CrApplication sharedApplication]; @@ -131,7 +132,8 @@ void CocoaTest::TearDown() { (spins < kCloseSpins || one_more_time)) { // Check the timeout before pumping events, so that we'll spin // the loop once after the timeout. - one_more_time = ([start_date timeIntervalSinceNow] > -kCloseTimeoutSeconds); + one_more_time = + ([start_date timeIntervalSinceNow] > -kCloseTimeoutSeconds); // Autorelease anything thrown up by the event loop. { diff --git a/chrome/browser/ui/cocoa/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/collected_cookies_mac.mm index 23ff4a5..ef19437 100644 --- a/chrome/browser/ui/cocoa/collected_cookies_mac.mm +++ b/chrome/browser/ui/cocoa/collected_cookies_mac.mm @@ -8,7 +8,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -137,7 +137,7 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) { tabContents_ = tabContents; NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"CollectedCookies" + [base::mac::MainAppBundle() pathForResource:@"CollectedCookies" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { [self loadTreeModelFromTabContents]; diff --git a/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm b/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm index 548b83a..6ad363b 100644 --- a/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm +++ b/chrome/browser/ui/cocoa/confirm_quit_panel_controller.mm @@ -6,7 +6,7 @@ #import <QuartzCore/QuartzCore.h> #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" @@ -29,7 +29,7 @@ ConfirmQuitPanelController* g_confirmQuitPanelController = nil; - (id)initInternal { NSString* nibPath = - [mac_util::MainAppBundle() pathForResource:@"ConfirmQuitPanel" + [base::mac::MainAppBundle() pathForResource:@"ConfirmQuitPanel" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { } diff --git a/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm b/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm index e9a426f6..eaced8e 100644 --- a/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm +++ b/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm @@ -8,7 +8,7 @@ #include "app/l10n_util_mac.h" #include "app/table_model_observer.h" #include "base/command_line.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" #include "chrome/browser/content_exceptions_table_model.h" @@ -151,7 +151,7 @@ static ContentExceptionsWindowController* settingsMap:(HostContentSettingsMap*)settingsMap otrSettingsMap:(HostContentSettingsMap*)otrSettingsMap { NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"ContentExceptionsWindow" + [base::mac::MainAppBundle() pathForResource:@"ContentExceptionsWindow" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { settingsType_ = settingsType; diff --git a/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm b/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm index f61c77a..1fb432e 100644 --- a/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm @@ -8,7 +8,7 @@ #include "app/l10n_util.h" #include "base/command_line.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "chrome/browser/content_settings/content_settings_details.h" #import "chrome/browser/content_settings/host_content_settings_map.h" #import "chrome/browser/geolocation/geolocation_content_settings_map.h" @@ -145,7 +145,7 @@ class PrefObserverDisabler { - (id)initWithProfile:(Profile*)profile { DCHECK(profile); NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"ContentSettings" + [base::mac::MainAppBundle() pathForResource:@"ContentSettings" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { profile_ = profile; diff --git a/chrome/browser/ui/cocoa/cookie_details_view_controller.mm b/chrome/browser/ui/cocoa/cookie_details_view_controller.mm index 9f47a54..d3e1ea5 100644 --- a/chrome/browser/ui/cocoa/cookie_details_view_controller.mm +++ b/chrome/browser/ui/cocoa/cookie_details_view_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/cookie_tree_node.h" #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" @@ -22,7 +22,7 @@ static const int kExtraMarginBelowWhenExpirationEditable = 5; - (id)init { return [super initWithNibName:@"CookieDetailsView" - bundle:mac_util::MainAppBundle()]; + bundle:base::mac::MainAppBundle()]; } - (void)awakeFromNib { diff --git a/chrome/browser/ui/cocoa/cookies_window_controller.mm b/chrome/browser/ui/cocoa/cookies_window_controller.mm index bf1bf68..5e5f74f 100644 --- a/chrome/browser/ui/cocoa/cookies_window_controller.mm +++ b/chrome/browser/ui/cocoa/cookies_window_controller.mm @@ -9,7 +9,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/profiles/profile.h" @@ -168,7 +168,7 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() { appcacheHelper:(BrowsingDataAppCacheHelper*)appcacheHelper indexedDBHelper:(BrowsingDataIndexedDBHelper*)indexedDBHelper { DCHECK(profile); - NSString* nibpath = [mac_util::MainAppBundle() pathForResource:@"Cookies" + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"Cookies" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { profile_ = profile; diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm index d2a8335..db5d5fa 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/text_elider.h" -#include "base/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/download/download_item_model.h" diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index be0be80..23603f8 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm @@ -7,7 +7,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" #include "app/text_elider.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/metrics/histogram.h" #include "base/string16.h" #include "base/string_util.h" @@ -98,7 +98,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { - (id)initWithModel:(BaseDownloadItemModel*)downloadModel shelf:(DownloadShelfController*)shelf { if ((self = [super initWithNibName:@"DownloadItem" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { // 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 4238b98..f88071f 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/download/download_manager.h" @@ -83,7 +83,7 @@ const NSTimeInterval kAutoCloseDelaySeconds = 5; - (id)initWithBrowser:(Browser*)browser resizeDelegate:(id<ViewResizer>)resizeDelegate { if ((self = [super initWithNibName:@"DownloadShelf" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { resizeDelegate_ = resizeDelegate; maxShelfHeight_ = NSHeight([[self view] bounds]); currentShelfHeight_ = maxShelfHeight_; diff --git a/chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.mm b/chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.mm index 06fc94b..7d83c74 100644 --- a/chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.mm @@ -7,7 +7,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/string16.h" #include "base/sys_string_conversions.h" #include "chrome/browser/search_engines/template_url.h" @@ -32,7 +32,7 @@ void ShiftOriginY(NSView* view, CGFloat amount) { delegate:(EditSearchEngineControllerDelegate*)delegate templateURL:(const TemplateURL*)url { DCHECK(profile); - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"EditSearchEngine" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/extension_installed_bubble_controller.mm b/chrome/browser/ui/cocoa/extension_installed_bubble_controller.mm index f417ff7..ad30096 100644 --- a/chrome/browser/ui/cocoa/extension_installed_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/extension_installed_bubble_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "base/i18n/rtl.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" @@ -80,7 +80,7 @@ class ExtensionLoadedNotificationObserver : public NotificationObserver { browser:(Browser*)browser icon:(SkBitmap)icon { NSString* nibPath = - [mac_util::MainAppBundle() pathForResource:@"ExtensionInstalledBubble" + [base::mac::MainAppBundle() pathForResource:@"ExtensionInstalledBubble" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { DCHECK(parentWindow); diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm index e40fcd4..09dc927 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_controller.mm @@ -6,7 +6,7 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -67,11 +67,11 @@ void OffsetControlVertically(NSControl* control, CGFloat amount) { // We use a different XIB in the case of no warnings, that is a little bit // more nicely laid out. if (warnings.empty()) { - nibpath = [mac_util::MainAppBundle() + nibpath = [base::mac::MainAppBundle() pathForResource:@"ExtensionInstallPromptNoWarnings" ofType:@"nib"]; } else { - nibpath = [mac_util::MainAppBundle() + nibpath = [base::mac::MainAppBundle() pathForResource:@"ExtensionInstallPrompt" ofType:@"nib"]; } diff --git a/chrome/browser/ui/cocoa/file_metadata.mm b/chrome/browser/ui/cocoa/file_metadata.mm index d19e3ac..ca199a5 100644 --- a/chrome/browser/ui/cocoa/file_metadata.mm +++ b/chrome/browser/ui/cocoa/file_metadata.mm @@ -9,7 +9,7 @@ #include "base/file_path.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "googleurl/src/gurl.h" @@ -98,7 +98,7 @@ void AddOriginMetadataToFile(const FilePath& file, const GURL& source, void AddQuarantineMetadataToFile(const FilePath& file, const GURL& source, const GURL& referrer) { FSRef file_ref; - if (!mac_util::FSRefFromPath(file.value(), &file_ref)) + if (!base::mac::FSRefFromPath(file.value(), &file_ref)) return; NSMutableDictionary* quarantine_properties = nil; diff --git a/chrome/browser/ui/cocoa/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar_cocoa_controller.mm index 05e5397..f8a40442 100644 --- a/chrome/browser/ui/cocoa/find_bar_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/find_bar_cocoa_controller.mm @@ -4,7 +4,7 @@ #import <Cocoa/Cocoa.h> -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -42,7 +42,7 @@ const float kFindBarCloseDuration = 0.15; - (id)init { if ((self = [super initWithNibName:@"FindBar" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { [[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 9590b9b..ed5d5b0 100644 --- a/chrome/browser/ui/cocoa/first_run_dialog.mm +++ b/chrome/browser/ui/cocoa/first_run_dialog.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/first_run_dialog.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/message_loop.h" #include "base/ref_counted.h" #include "grit/locale_settings.h" @@ -58,7 +58,7 @@ void FirstRunShowBridge::ShowDialog() { - (id)init { NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"FirstRunDialog" + [base::mac::MainAppBundle() pathForResource:@"FirstRunDialog" ofType:@"nib"]; self = [super initWithWindowNibPath:nibpath owner:self]; if (self != nil) { diff --git a/chrome/browser/ui/cocoa/floating_bar_backing_view.mm b/chrome/browser/ui/cocoa/floating_bar_backing_view.mm index 70f785c..695946f 100644 --- a/chrome/browser/ui/cocoa/floating_bar_backing_view.mm +++ b/chrome/browser/ui/cocoa/floating_bar_backing_view.mm @@ -4,7 +4,7 @@ #include "chrome/browser/ui/cocoa/floating_bar_backing_view.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "chrome/browser/ui/cocoa/browser_frame_view.h" @implementation FloatingBarBackingView @@ -44,7 +44,7 @@ // a double-click in the blank area should try to minimize, to be consistent // with double-clicks on the contiguous tab strip area. (It'll fail and beep.) if ([event clickCount] == 2 && - mac_util::ShouldWindowsMiniaturizeOnDoubleClick()) + base::mac::ShouldWindowsMiniaturizeOnDoubleClick()) [[self window] performMiniaturize:self]; } diff --git a/chrome/browser/ui/cocoa/font_language_settings_controller.mm b/chrome/browser/ui/cocoa/font_language_settings_controller.mm index 4beff2a..9bb9c6b 100644 --- a/chrome/browser/ui/cocoa/font_language_settings_controller.mm +++ b/chrome/browser/ui/cocoa/font_language_settings_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/font_language_settings_controller.h" #import <Cocoa/Cocoa.h> -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/fonts_languages_window.h" @@ -33,7 +33,7 @@ void ShowFontsLanguagesWindow(gfx::NativeWindow window, - (id)initWithProfile:(Profile*)profile { DCHECK(profile); - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"FontLanguageSettings" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/fullscreen_controller.h b/chrome/browser/ui/cocoa/fullscreen_controller.h index 474d699..14aebfc 100644 --- a/chrome/browser/ui/cocoa/fullscreen_controller.h +++ b/chrome/browser/ui/cocoa/fullscreen_controller.h @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> #import "base/mac/cocoa_protocols.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" @class BrowserWindowController; @@ -69,7 +69,7 @@ // (which can happen when a fullscreen window is closed). Used to track the // current state and make sure we properly restore the menu bar when this // controller is destroyed. - mac_util::FullScreenMode currentFullscreenMode_; + base::mac::FullScreenMode currentFullscreenMode_; } @property(readonly, nonatomic) BOOL isFullscreen; diff --git a/chrome/browser/ui/cocoa/fullscreen_controller.mm b/chrome/browser/ui/cocoa/fullscreen_controller.mm index 0f06e22..186ea78 100644 --- a/chrome/browser/ui/cocoa/fullscreen_controller.mm +++ b/chrome/browser/ui/cocoa/fullscreen_controller.mm @@ -6,6 +6,7 @@ #include <algorithm> +#import "base/mac/mac_util.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" @@ -102,7 +103,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; // Returns |kFullScreenModeHideAll| when the overlay is hidden and // |kFullScreenModeHideDock| when the overlay is shown. -- (mac_util::FullScreenMode)desiredFullscreenMode; +- (base::mac::FullScreenMode)desiredFullscreenMode; // Change the overlay to the given fraction, with or without animation. Only // guaranteed to work properly with |fraction == 0| or |fraction == 1|. This @@ -166,7 +167,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; - (id)initWithBrowserController:(BrowserWindowController*)controller { if ((self == [super init])) { browserController_ = controller; - currentFullscreenMode_ = mac_util::kFullScreenModeNormal; + currentFullscreenMode_ = base::mac::kFullScreenModeNormal; } // Let the world know what we're up to. @@ -315,12 +316,12 @@ const CGFloat kFloatingBarVerticalOffset = 22; - (void)changeFloatingBarShownFraction:(CGFloat)fraction { [browserController_ setFloatingBarShownFraction:fraction]; - mac_util::FullScreenMode desiredMode = [self desiredFullscreenMode]; + base::mac::FullScreenMode desiredMode = [self desiredFullscreenMode]; if (desiredMode != currentFullscreenMode_ && [self shouldToggleMenuBar]) { - if (currentFullscreenMode_ == mac_util::kFullScreenModeNormal) - mac_util::RequestFullScreen(desiredMode); + if (currentFullscreenMode_ == base::mac::kFullScreenModeNormal) + base::mac::RequestFullScreen(desiredMode); else - mac_util::SwitchFullScreenModes(currentFullscreenMode_, desiredMode); + base::mac::SwitchFullScreenModes(currentFullscreenMode_, desiredMode); currentFullscreenMode_ = desiredMode; } } @@ -405,10 +406,10 @@ const CGFloat kFloatingBarVerticalOffset = 22; [[browserController_ window] isMainWindow]; } -- (mac_util::FullScreenMode)desiredFullscreenMode { +- (base::mac::FullScreenMode)desiredFullscreenMode { if ([browserController_ floatingBarShownFraction] >= 1.0) - return mac_util::kFullScreenModeHideDock; - return mac_util::kFullScreenModeHideAll; + return base::mac::kFullScreenModeHideDock; + return base::mac::kFullScreenModeHideAll; } - (void)changeOverlayToFraction:(CGFloat)fraction @@ -608,13 +609,13 @@ const CGFloat kFloatingBarVerticalOffset = 22; } - (void)showActiveWindowUI { - DCHECK_EQ(currentFullscreenMode_, mac_util::kFullScreenModeNormal); - if (currentFullscreenMode_ != mac_util::kFullScreenModeNormal) + DCHECK_EQ(currentFullscreenMode_, base::mac::kFullScreenModeNormal); + if (currentFullscreenMode_ != base::mac::kFullScreenModeNormal) return; if ([self shouldToggleMenuBar]) { - mac_util::FullScreenMode desiredMode = [self desiredFullscreenMode]; - mac_util::RequestFullScreen(desiredMode); + base::mac::FullScreenMode desiredMode = [self desiredFullscreenMode]; + base::mac::RequestFullScreen(desiredMode); currentFullscreenMode_ = desiredMode; } @@ -622,9 +623,9 @@ const CGFloat kFloatingBarVerticalOffset = 22; } - (void)hideActiveWindowUI { - if (currentFullscreenMode_ != mac_util::kFullScreenModeNormal) { - mac_util::ReleaseFullScreen(currentFullscreenMode_); - currentFullscreenMode_ = mac_util::kFullScreenModeNormal; + if (currentFullscreenMode_ != base::mac::kFullScreenModeNormal) { + base::mac::ReleaseFullScreen(currentFullscreenMode_); + currentFullscreenMode_ = base::mac::kFullScreenModeNormal; } // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 diff --git a/chrome/browser/ui/cocoa/fullscreen_window.mm b/chrome/browser/ui/cocoa/fullscreen_window.mm index ecbb34c..ee4b881 100644 --- a/chrome/browser/ui/cocoa/fullscreen_window.mm +++ b/chrome/browser/ui/cocoa/fullscreen_window.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/fullscreen_window.h" -#include "base/mac_util.h" #include "chrome/browser/themes/browser_theme_provider.h" #import "chrome/browser/ui/cocoa/themed_window.h" diff --git a/chrome/browser/ui/cocoa/hung_renderer_controller.mm b/chrome/browser/ui/cocoa/hung_renderer_controller.mm index 130a3f7..2c9d337 100644 --- a/chrome/browser/ui/cocoa/hung_renderer_controller.mm +++ b/chrome/browser/ui/cocoa/hung_renderer_controller.mm @@ -8,7 +8,7 @@ #include "app/resource_bundle.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/process_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_list.h" @@ -35,7 +35,7 @@ HungRendererController* g_instance = NULL; @implementation HungRendererController - (id)initWithWindowNibName:(NSString*)nibName { - NSString* nibpath = [mac_util::MainAppBundle() pathForResource:nibName + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:nibName ofType:@"nib"]; self = [super initWithWindowNibPath:nibpath owner:self]; if (self) { diff --git a/chrome/browser/ui/cocoa/import_progress_dialog.mm b/chrome/browser/ui/cocoa/import_progress_dialog.mm index 6ec0ed5..fe82f1f 100644 --- a/chrome/browser/ui/cocoa/import_progress_dialog.mm +++ b/chrome/browser/ui/cocoa/import_progress_dialog.mm @@ -7,7 +7,7 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/message_loop.h" #import "base/scoped_nsobject.h" #import "base/sys_string_conversions.h" @@ -57,7 +57,7 @@ NSString* keyForImportItem(importer::ImportItem item) { observer:(ImportObserver*)observer itemsEnabled:(int16)items { NSString* nib_path = - [mac_util::MainAppBundle() pathForResource:@"ImportProgressDialog" + [base::mac::MainAppBundle() pathForResource:@"ImportProgressDialog" ofType:@"nib"]; self = [super initWithWindowNibPath:nib_path owner:self]; if (self != nil) { diff --git a/chrome/browser/ui/cocoa/import_settings_dialog.mm b/chrome/browser/ui/cocoa/import_settings_dialog.mm index 5e6da7a..d395999 100644 --- a/chrome/browser/ui/cocoa/import_settings_dialog.mm +++ b/chrome/browser/ui/cocoa/import_settings_dialog.mm @@ -4,7 +4,7 @@ #import "chrome/browser/ui/cocoa/import_settings_dialog.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/importer/importer_data_types.h" #include "chrome/browser/importer/importer_list.h" @@ -140,7 +140,7 @@ bool importSettingsDialogVisible = false; - (id)initWithProfiles:(NSArray*)profiles { NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"ImportSettingsDialog" + [base::mac::MainAppBundle() pathForResource:@"ImportSettingsDialog" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { sourceBrowsersList_.reset([profiles retain]); diff --git a/chrome/browser/ui/cocoa/importer_lock_dialog.mm b/chrome/browser/ui/cocoa/importer_lock_dialog.mm index cc94ce5..2a140ae 100644 --- a/chrome/browser/ui/cocoa/importer_lock_dialog.mm +++ b/chrome/browser/ui/cocoa/importer_lock_dialog.mm @@ -7,7 +7,6 @@ #import "importer_lock_dialog.h" #include "app/l10n_util_mac.h" -#include "base/mac_util.h" #include "base/message_loop.h" #include "base/scoped_nsobject.h" #include "chrome/browser/importer/importer.h" diff --git a/chrome/browser/ui/cocoa/infobar_container_controller.mm b/chrome/browser/ui/cocoa/infobar_container_controller.mm index adca3e7..3eb29dc 100644 --- a/chrome/browser/ui/cocoa/infobar_container_controller.mm +++ b/chrome/browser/ui/cocoa/infobar_container_controller.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents.h" #import "chrome/browser/ui/cocoa/animatable_view.h" @@ -71,7 +71,7 @@ class InfoBarNotificationObserver : public NotificationObserver { - (id)initWithResizeDelegate:(id<ViewResizer>)resizeDelegate { DCHECK(resizeDelegate); if ((self = [super initWithNibName:@"InfoBarContainer" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { resizeDelegate_ = resizeDelegate; infoBarObserver_.reset(new InfoBarNotificationObserver(self)); diff --git a/chrome/browser/ui/cocoa/infobar_controller.mm b/chrome/browser/ui/cocoa/infobar_controller.mm index ae1414c..432c00b 100644 --- a/chrome/browser/ui/cocoa/infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobar_controller.mm @@ -5,7 +5,7 @@ #import <Cocoa/Cocoa.h> #include "base/logging.h" // for NOTREACHED() -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #import "chrome/browser/ui/cocoa/animatable_view.h" @@ -101,7 +101,7 @@ const float kAnimateCloseDuration = 0.12; - (id)initWithDelegate:(InfoBarDelegate*)delegate { DCHECK(delegate); if ((self = [super initWithNibName:@"InfoBar" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { delegate_ = delegate; } return self; diff --git a/chrome/browser/ui/cocoa/install_from_dmg.mm b/chrome/browser/ui/cocoa/install_from_dmg.mm index d18e257..aa892cf 100644 --- a/chrome/browser/ui/cocoa/install_from_dmg.mm +++ b/chrome/browser/ui/cocoa/install_from_dmg.mm @@ -18,7 +18,7 @@ #include "base/basictypes.h" #include "base/command_line.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "chrome/browser/ui/cocoa/authorization_util.h" #include "chrome/browser/ui/cocoa/scoped_authorizationref.h" @@ -409,7 +409,7 @@ bool MaybeInstallFromDiskImage() { } NSString* installer_path = - [mac_util::MainAppBundle() pathForResource:@"install" ofType:@"sh"]; + [base::mac::MainAppBundle() pathForResource:@"install" ofType:@"sh"]; if (!installer_path) { VLOG(1) << "Could not locate install.sh"; return false; diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm index 299fd35..07405d6 100644 --- a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm +++ b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/instant_confirm_window_controller.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/instant/instant_confirm_dialog.h" #include "chrome/browser/instant/instant_controller.h" #include "chrome/browser/profiles/profile.h" @@ -31,7 +31,7 @@ void ShowInstantConfirmDialog(gfx::NativeWindow parent, Profile* profile) { @implementation InstantConfirmWindowController - (id)initWithProfile:(Profile*)profile { - NSString* nibPath = [mac_util::MainAppBundle() + NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"InstantConfirm" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { diff --git a/chrome/browser/ui/cocoa/keystone_glue.mm b/chrome/browser/ui/cocoa/keystone_glue.mm index 79e95fc..8ac3daf 100644 --- a/chrome/browser/ui/cocoa/keystone_glue.mm +++ b/chrome/browser/ui/cocoa/keystone_glue.mm @@ -12,7 +12,7 @@ #include "app/l10n_util.h" #import "app/l10n_util_mac.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "base/sys_string_conversions.h" #include "base/ref_counted.h" @@ -438,9 +438,9 @@ NSString* const kBrandKey = @"KSBrandID"; return NO; // Load the KeystoneRegistration framework bundle if present. It lives - // inside the framework, so use mac_util::MainAppBundle(); + // inside the framework, so use base::mac::MainAppBundle(); NSString* ksrPath = - [[mac_util::MainAppBundle() privateFrameworksPath] + [[base::mac::MainAppBundle() privateFrameworksPath] stringByAppendingPathComponent:@"KeystoneRegistration.framework"]; NSBundle* ksrBundle = [NSBundle bundleWithPath:ksrPath]; [ksrBundle load]; @@ -722,7 +722,7 @@ NSString* const kBrandKey = @"KSBrandID"; // to files and directories. NSFileManager* fileManager = [NSFileManager defaultManager]; NSString* executablePath = [[NSBundle mainBundle] executablePath]; - NSString* frameworkPath = [mac_util::MainAppBundle() bundlePath]; + NSString* frameworkPath = [base::mac::MainAppBundle() bundlePath]; return ![fileManager isWritableFileAtPath:appPath_] || ![fileManager isWritableFileAtPath:executablePath] || ![fileManager isWritableFileAtPath:frameworkPath]; @@ -809,7 +809,7 @@ NSString* const kBrandKey = @"KSBrandID"; // However, preflight operation (and promotion) should only be asynchronous // if the synchronous parameter is NO. NSString* preflightPath = - [mac_util::MainAppBundle() pathForResource:@"keystone_promote_preflight" + [base::mac::MainAppBundle() pathForResource:@"keystone_promote_preflight" ofType:@"sh"]; const char* preflightPathC = [preflightPath fileSystemRepresentation]; const char* userBrandFile = NULL; @@ -895,7 +895,7 @@ NSString* const kBrandKey = @"KSBrandID"; SEL selector = @selector(changePermissionsForPromotionWithTool:); NSString* toolPath = - [mac_util::MainAppBundle() pathForResource:@"keystone_promote_postflight" + [base::mac::MainAppBundle() pathForResource:@"keystone_promote_postflight" ofType:@"sh"]; PerformBridge::PostPerform(self, selector, toolPath); diff --git a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm index f8b3aa6..2ae0fa6 100644 --- a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm @@ -6,7 +6,7 @@ #import "chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/lazy_instance.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -146,7 +146,7 @@ static base::LazyInstance<ProfileControllerMap> g_profile_controller_map( - (id)initWithProfile:(Profile*)profile { DCHECK(profile); - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"KeywordEditor" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { 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 17b0d15..9750caf 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,13 @@ #import "chrome/browser/ui/cocoa/location_bar/instant_opt_in_controller.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" @implementation InstantOptInController - (id)initWithDelegate:(InstantOptInControllerDelegate*)delegate { if ((self = [super initWithNibName:@"InstantOptIn" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { 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 f0d914e..b7daca6f 100644 --- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm +++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm @@ -8,7 +8,7 @@ #include "app/mac/nsimage_cache.h" #include "app/resource_bundle.h" #import "base/mac/cocoa_protocols.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "base/scoped_nsobject.h" #include "base/utf_string_conversions.h" #include "chrome/browser/notifications/balloon.h" @@ -43,7 +43,7 @@ const int kRightMargin = 2; - (id)initWithBalloon:(Balloon*)balloon { NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"Notification" + [base::mac::MainAppBundle() pathForResource:@"Notification" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { balloon_ = balloon; diff --git a/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm b/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm index b00fb5b..5425125 100644 --- a/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm +++ b/chrome/browser/ui/cocoa/nsimage_cache_unittest.mm @@ -6,7 +6,7 @@ #include "app/mac/nsimage_cache.h" #include "base/file_path.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/path_service.h" #include "chrome/common/chrome_constants.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,10 +24,10 @@ class NSImageCacheTest : public PlatformTest { FilePath path; PathService::Get(base::DIR_EXE, &path); path = path.Append(chrome::kFrameworkName); - mac_util::SetOverrideAppBundlePath(path); + base::mac::SetOverrideAppBundlePath(path); } virtual ~NSImageCacheTest() { - mac_util::SetOverrideAppBundle(nil); + base::mac::SetOverrideAppBundle(nil); } }; diff --git a/chrome/browser/ui/cocoa/preferences_window_controller.mm b/chrome/browser/ui/cocoa/preferences_window_controller.mm index d582680..950ec7b 100644 --- a/chrome/browser/ui/cocoa/preferences_window_controller.mm +++ b/chrome/browser/ui/cocoa/preferences_window_controller.mm @@ -10,7 +10,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_aedesc.h" #include "base/string16.h" #include "base/string_util.h" @@ -489,7 +489,7 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase { DCHECK(profile); // Use initWithWindowNibPath:: instead of initWithWindowNibName: so we // can override it in a unit test. - NSString* nibPath = [mac_util::MainAppBundle() + NSString* nibPath = [base::mac::MainAppBundle() pathForResource:@"Preferences" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { @@ -675,9 +675,10 @@ class ManagedPrefsBannerState : public policy::ManagedPrefsBannerBase { verticalShift += AutoSizeGroup(basicsGroupDefaultBrowser_, kAutoSizeGroupBehaviorVerticalFirstToFit, verticalShift); - verticalShift += AutoSizeGroup(basicsGroupSearchEngine_, - kAutoSizeGroupBehaviorFirstTwoAsRowVerticalToFit, - verticalShift); + verticalShift += AutoSizeGroup( + basicsGroupSearchEngine_, + kAutoSizeGroupBehaviorFirstTwoAsRowVerticalToFit, + verticalShift); verticalShift += AutoSizeGroup(basicsGroupToolbar_, kAutoSizeGroupBehaviorVerticalToFit, verticalShift); diff --git a/chrome/browser/ui/cocoa/previewable_contents_controller.mm b/chrome/browser/ui/cocoa/previewable_contents_controller.mm index 2dfa146..74e29b0 100644 --- a/chrome/browser/ui/cocoa/previewable_contents_controller.mm +++ b/chrome/browser/ui/cocoa/previewable_contents_controller.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/previewable_contents_controller.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/tab_contents/tab_contents.h" @implementation PreviewableContentsController @@ -14,7 +14,7 @@ - (id)init { if ((self = [super initWithNibName:@"PreviewableContents" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { } return self; } diff --git a/chrome/browser/ui/cocoa/sad_tab_controller.mm b/chrome/browser/ui/cocoa/sad_tab_controller.mm index ba0b102..e340a9c 100644 --- a/chrome/browser/ui/cocoa/sad_tab_controller.mm +++ b/chrome/browser/ui/cocoa/sad_tab_controller.mm @@ -4,7 +4,7 @@ #include "chrome/browser/ui/cocoa/sad_tab_controller.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "chrome/browser/ui/cocoa/sad_tab_view.h" @implementation SadTabController @@ -12,7 +12,7 @@ - (id)initWithTabContents:(TabContents*)someTabContents superview:(NSView*)superview { if ((self = [super initWithNibName:@"SadTab" - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { tabContents_ = someTabContents; NSView* view = [self view]; diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm index 2a79e09..fa53295 100644 --- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm @@ -8,7 +8,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "base/time.h" #include "chrome/browser/profiles/profile.h" @@ -68,7 +68,7 @@ void SearchEngineDialogControllerBridge::OnTemplateURLModelChanged() { - (id)init { NSString* nibpath = - [mac_util::MainAppBundle() pathForResource:@"SearchEngineDialog" + [base::mac::MainAppBundle() pathForResource:@"SearchEngineDialog" ofType:@"nib"]; self = [super initWithWindowNibPath:nibpath owner:self]; if (self != nil) { diff --git a/chrome/browser/ui/cocoa/shell_dialogs_mac.mm b/chrome/browser/ui/cocoa/shell_dialogs_mac.mm index 2148539..24b1bc9 100644 --- a/chrome/browser/ui/cocoa/shell_dialogs_mac.mm +++ b/chrome/browser/ui/cocoa/shell_dialogs_mac.mm @@ -15,7 +15,7 @@ #include "base/file_util.h" #include "base/logging.h" #import "base/mac/cocoa_protocols.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" @@ -289,7 +289,7 @@ NSView* SelectFileDialogImpl::GetAccessoryView(const FileTypeInfo* file_types, DCHECK(file_types); scoped_nsobject<NSNib> nib ( [[NSNib alloc] initWithNibNamed:@"SaveAccessoryView" - bundle:mac_util::MainAppBundle()]); + bundle:base::mac::MainAppBundle()]); if (!nib) return nil; diff --git a/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm b/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm index 7beac9c..7b4c1f8 100644 --- a/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm +++ b/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm @@ -7,7 +7,7 @@ #include "app/l10n_util_mac.h" #include "app/table_model_observer.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" #include "grit/generated_resources.h" @@ -36,7 +36,7 @@ SimpleContentExceptionsWindowController* g_exceptionWindow = nil; } - (id)initWithTableModel:(RemoveRowsTableModel*)model { - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"SimpleContentExceptionsWindow" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/speech_input_window_controller.mm b/chrome/browser/ui/cocoa/speech_input_window_controller.mm index c490bc1..abb9128 100644 --- a/chrome/browser/ui/cocoa/speech_input_window_controller.mm +++ b/chrome/browser/ui/cocoa/speech_input_window_controller.mm @@ -7,9 +7,7 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" #include "base/logging.h" -#include "base/mac_util.h" #include "base/sys_string_conversions.h" - #include "chrome/browser/ui/cocoa/info_bubble_view.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/cocoa/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents_controller.mm index c7b5cf8..f710755 100644 --- a/chrome/browser/ui/cocoa/tab_contents_controller.mm +++ b/chrome/browser/ui/cocoa/tab_contents_controller.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/tab_contents_controller.h" -#include "base/mac_util.h" #include "base/scoped_nsobject.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" diff --git a/chrome/browser/ui/cocoa/tab_controller.mm b/chrome/browser/ui/cocoa/tab_controller.mm index 2ae2454..f05bb21 100644 --- a/chrome/browser/ui/cocoa/tab_controller.mm +++ b/chrome/browser/ui/cocoa/tab_controller.mm @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #import "chrome/browser/themes/browser_theme_provider.h" #import "chrome/browser/ui/cocoa/menu_controller.h" #import "chrome/browser/ui/cocoa/tab_controller.h" @@ -73,7 +73,7 @@ class MenuDelegate : public menus::SimpleMenuModel::Delegate { } - (id)init { - self = [super initWithNibName:@"TabView" bundle:mac_util::MainAppBundle()]; + self = [super initWithNibName:@"TabView" bundle:base::mac::MainAppBundle()]; if (self != nil) { isIconShowing_ = YES; NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm index 826910c..fa9f037 100644 --- a/chrome/browser/ui/cocoa/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm @@ -12,7 +12,6 @@ #include "app/l10n_util.h" #include "app/mac/nsimage_cache.h" #include "app/resource_bundle.h" -#include "base/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/autocomplete/autocomplete.h" diff --git a/chrome/browser/ui/cocoa/tab_strip_view.mm b/chrome/browser/ui/cocoa/tab_strip_view.mm index 2456362..857da65 100644 --- a/chrome/browser/ui/cocoa/tab_strip_view.mm +++ b/chrome/browser/ui/cocoa/tab_strip_view.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/tab_strip_view.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "chrome/browser/themes/browser_theme_provider.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/tab_strip_controller.h" @@ -156,7 +156,7 @@ // "short" as 0.8 seconds. (Measuring up-to-up isn't enough to properly // detect double-clicks, but we're actually using Cocoa for that.) if (clickCount == 2 && (timestamp - lastMouseUp_) < 0.8) { - if (mac_util::ShouldWindowsMiniaturizeOnDoubleClick()) + if (base::mac::ShouldWindowsMiniaturizeOnDoubleClick()) [[self window] performMiniaturize:self]; } else { [super mouseUp:event]; diff --git a/chrome/browser/ui/cocoa/tab_view.mm b/chrome/browser/ui/cocoa/tab_view.mm index 128b83f..0a655ad 100644 --- a/chrome/browser/ui/cocoa/tab_view.mm +++ b/chrome/browser/ui/cocoa/tab_view.mm @@ -5,7 +5,7 @@ #import "chrome/browser/ui/cocoa/tab_view.h" #include "base/logging.h" -#import "base/mac_util.h" +#import "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "chrome/browser/accessibility/browser_accessibility_state.h" #include "chrome/browser/themes/browser_theme_provider.h" @@ -988,14 +988,14 @@ const CGFloat kRapidCloseDist = 2.5; DCHECK(CFGetTypeID(dict) == CFDictionaryGetTypeID()); // Sanity check the ID. - CFNumberRef otherIDRef = (CFNumberRef)mac_util::GetValueFromDictionary( + CFNumberRef otherIDRef = (CFNumberRef)base::mac::GetValueFromDictionary( dict, kCGWindowNumber, CFNumberGetTypeID()); CGWindowID otherID; if (otherIDRef && CFNumberGetValue(otherIDRef, kCGWindowIDCFNumberType, &otherID) && otherID == windowID) { // And then get the workspace. - CFNumberRef workspaceRef = (CFNumberRef)mac_util::GetValueFromDictionary( + CFNumberRef workspaceRef = (CFNumberRef)base::mac::GetValueFromDictionary( dict, kCGWindowWorkspace, CFNumberGetTypeID()); if (!workspaceRef || !CFNumberGetValue(workspaceRef, kCFNumberIntType, &workspace)) { diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index 7f96f59..b9e4a3d 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -7,7 +7,7 @@ #import <QuartzCore/QuartzCore.h> #include "app/resource_bundle.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/scoped_callback_factory.h" #include "base/sys_string_conversions.h" @@ -1020,7 +1020,7 @@ void AnimateCALayerOpacityFromTo( nsFavicon = defaultFavIcon; } base::mac::ScopedCFTypeRef<CGImageRef> favicon( - mac_util::CopyNSImageToCGImage(nsFavicon)); + base::mac::CopyNSImageToCGImage(nsFavicon)); CALayer* faviconLayer = [CALayer layer]; if (showZoom) { diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index c11564c..28cbba0 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm @@ -8,7 +8,7 @@ #include <vector> #include "app/l10n_util_mac.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" #include "chrome/browser/browser_process.h" #import "chrome/browser/ui/cocoa/window_size_autosaver.h" @@ -103,7 +103,7 @@ class SortHelper { @implementation TaskManagerWindowController - (id)initWithTaskManagerObserver:(TaskManagerMac*)taskManagerObserver { - NSString* nibpath = [mac_util::MainAppBundle() + NSString* nibpath = [base::mac::MainAppBundle() pathForResource:@"TaskManager" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { diff --git a/chrome/browser/ui/cocoa/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar_controller.mm index 1b953fd..22d3dde 100644 --- a/chrome/browser/ui/cocoa/toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar_controller.mm @@ -12,7 +12,7 @@ #include "app/menus/accelerator_cocoa.h" #include "app/menus/menu_model.h" #include "app/resource_bundle.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/singleton.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -170,7 +170,7 @@ class NotificationBridge : public NotificationObserver { nibFileNamed:(NSString*)nibName { DCHECK(model && commands && profile && [nibName length]); if ((self = [super initWithNibName:nibName - bundle:mac_util::MainAppBundle()])) { + bundle:base::mac::MainAppBundle()])) { toolbarModel_ = model; commands_ = commands; profile_ = profile; diff --git a/chrome/browser/ui/cocoa/translate/translate_infobar_base.mm b/chrome/browser/ui/cocoa/translate/translate_infobar_base.mm index 4a08895..a91cd11 100644 --- a/chrome/browser/ui/cocoa/translate/translate_infobar_base.mm +++ b/chrome/browser/ui/cocoa/translate/translate_infobar_base.mm @@ -7,7 +7,6 @@ #include "app/l10n_util.h" #include "base/logging.h" -#include "base/mac_util.h" #include "base/metrics/histogram.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" diff --git a/chrome/browser/ui/login/login_prompt_mac.mm b/chrome/browser/ui/login/login_prompt_mac.mm index 2ee0252..0547e39 100644 --- a/chrome/browser/ui/login/login_prompt_mac.mm +++ b/chrome/browser/ui/login/login_prompt_mac.mm @@ -6,7 +6,7 @@ #import "chrome/browser/ui/login/login_prompt_mac.h" #include "app/l10n_util.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/string_util.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -127,7 +127,7 @@ LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, - (id)initWithLoginHandler:(LoginHandlerMac*)handler { NSString* nibPath = - [mac_util::MainAppBundle() pathForResource:@"HttpAuthLoginSheet" + [base::mac::MainAppBundle() pathForResource:@"HttpAuthLoginSheet" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibPath owner:self])) { diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 1b8e612..344db91 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -15,7 +15,7 @@ #include "chrome/common/chrome_switches.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif namespace { @@ -39,7 +39,7 @@ bool GetInternalPluginsDirectory(FilePath* result) { #if defined(OS_MACOSX) // If called from Chrome, get internal plugins from a subdirectory of the // framework. - if (mac_util::AmIBundled()) { + if (base::mac::AmIBundled()) { *result = chrome::GetFrameworkBundlePath(); DCHECK(!result->empty()); *result = result->Append("Internet Plug-Ins"); @@ -79,7 +79,7 @@ bool PathProvider(int key, FilePath* result) { #if defined(OS_MACOSX) if (!PathService::Get(base::DIR_EXE, result)) return false; - if (mac_util::AmIBundled()) { + if (base::mac::AmIBundled()) { // If we're called from chrome, dump it beside the app (outside the // app bundle), if we're called from a unittest, we'll already // outside the bundle so use the exe dir. @@ -145,7 +145,7 @@ bool PathProvider(int key, FilePath* result) { break; case chrome::DIR_RESOURCES: #if defined(OS_MACOSX) - cur = mac_util::MainAppBundlePath(); + cur = base::mac::MainAppBundlePath(); cur = cur.Append(FILE_PATH_LITERAL("Resources")); #else if (!PathService::Get(chrome::DIR_APP, &cur)) @@ -253,8 +253,8 @@ bool PathProvider(int key, FilePath* result) { break; case chrome::FILE_RESOURCES_PACK: #if defined(OS_MACOSX) - if (mac_util::AmIBundled()) { - cur = mac_util::MainAppBundlePath(); + if (base::mac::AmIBundled()) { + cur = base::mac::MainAppBundlePath(); cur = cur.Append(FILE_PATH_LITERAL("Resources")) .Append(FILE_PATH_LITERAL("resources.pak")); break; diff --git a/chrome/common/chrome_paths_mac.mm b/chrome/common/chrome_paths_mac.mm index 57ed3bd..fc76b53 100644 --- a/chrome/common/chrome_paths_mac.mm +++ b/chrome/common/chrome_paths_mac.mm @@ -8,7 +8,7 @@ #include "base/base_paths.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/path_service.h" #include "chrome/common/chrome_constants.h" @@ -45,7 +45,7 @@ bool GetChromeFrameUserDataDirectory(FilePath* result) { } bool GetUserDocumentsDirectory(FilePath* result) { - return mac_util::GetUserDirectory(NSDocumentDirectory, result); + return base::mac::GetUserDirectory(NSDocumentDirectory, result); } void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) { @@ -71,11 +71,11 @@ void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) { } bool GetUserDownloadsDirectory(FilePath* result) { - return mac_util::GetUserDirectory(NSDownloadsDirectory, result); + return base::mac::GetUserDirectory(NSDownloadsDirectory, result); } bool GetUserDesktop(FilePath* result) { - return mac_util::GetUserDirectory(NSDesktopDirectory, result); + return base::mac::GetUserDirectory(NSDesktopDirectory, result); } FilePath GetVersionedDirectory() { @@ -90,7 +90,7 @@ FilePath GetVersionedDirectory() { path = path.DirName().DirName(); DCHECK_EQ(path.BaseName().value(), "Contents"); - if (mac_util::IsBackgroundOnlyProcess()) { + if (base::mac::IsBackgroundOnlyProcess()) { // path identifies the helper .app's Contents directory in the browser // .app's versioned directory. Go up two steps to get to the browser // .app's versioned directory. @@ -128,7 +128,7 @@ FilePath GetFrameworkBundlePath() { } bool GetLocalLibraryDirectory(FilePath* result) { - return mac_util::GetLocalDirectory(NSLibraryDirectory, result); + return base::mac::GetLocalDirectory(NSLibraryDirectory, result); } } // namespace chrome diff --git a/chrome/common/font_loader_mac.mm b/chrome/common/font_loader_mac.mm index 3ab57c4..b910eb0 100644 --- a/chrome/common/font_loader_mac.mm +++ b/chrome/common/font_loader_mac.mm @@ -10,7 +10,7 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/sys_string_conversions.h" // static @@ -50,7 +50,7 @@ bool FontLoader::LoadFontIntoBuffer(NSFont* font_to_encode, LOG(ERROR) << "Failed to find font file for " << font_name; return false; } - FilePath font_path = FilePath(mac_util::PathFromFSRef(font_fsref)); + FilePath font_path = FilePath(base::mac::PathFromFSRef(font_fsref)); // Load file into shared memory buffer. int64 font_file_size_64 = -1; diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm index d0b160a..78941e8 100644 --- a/chrome/common/sandbox_mac.mm +++ b/chrome/common/sandbox_mac.mm @@ -17,7 +17,7 @@ extern "C" { #include "base/basictypes.h" #include "base/command_line.h" #include "base/file_util.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/rand_util_c.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsautorelease_pool.h" @@ -196,8 +196,8 @@ void Sandbox::SandboxWarmup(SandboxProcessType sandbox_type) { kCGBitmapByteOrder32Host)); // Load in the color profiles we'll need (as a side effect). - (void) mac_util::GetSRGBColorSpace(); - (void) mac_util::GetSystemColorSpace(); + (void) base::mac::GetSRGBColorSpace(); + (void) base::mac::GetSystemColorSpace(); // CGColorSpaceCreateSystemDefaultCMYK - 10.6 base::mac::ScopedCFTypeRef<CGColorSpaceRef> cmyk_colorspace( @@ -360,7 +360,7 @@ NSString* LoadSandboxTemplate(Sandbox::SandboxProcessType sandbox_type) { // Read in the sandbox profile and the common prefix file. NSString* common_sandbox_prefix_path = - [mac_util::MainAppBundle() pathForResource:@"common" + [base::mac::MainAppBundle() pathForResource:@"common" ofType:@"sb"]; NSString* common_sandbox_prefix_data = [NSString stringWithContentsOfFile:common_sandbox_prefix_path @@ -374,7 +374,7 @@ NSString* LoadSandboxTemplate(Sandbox::SandboxProcessType sandbox_type) { } NSString* sandbox_profile_path = - [mac_util::MainAppBundle() pathForResource:sandbox_config_filename + [base::mac::MainAppBundle() pathForResource:sandbox_config_filename ofType:@"sb"]; NSString* sandbox_data = [NSString stringWithContentsOfFile:sandbox_profile_path diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 399da12..1400e4a 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -41,7 +41,7 @@ #include "app/x11_util.h" #elif defined(OS_MACOSX) #include "app/l10n_util.h" -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/sys_string_conversions.h" #include "grit/chromium_strings.h" @@ -100,7 +100,7 @@ PluginThread::PluginThread() base::mac::ScopedCFTypeRef<CFStringRef> process_name( CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ (%@)"), plugin_name.get(), app_name.get())); - mac_util::SetProcessName(process_name); + base::mac::SetProcessName(process_name); #endif } diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 1d7a077..8aeed6c 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -24,7 +24,7 @@ #include "webkit/plugins/npapi/webplugin_delegate_impl.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "chrome/plugin/webplugin_accelerated_surface_proxy_mac.h" #endif @@ -573,7 +573,7 @@ void WebPluginProxy::SetWindowlessBuffer( window_rect.width(), window_rect.height(), 8, 4 * window_rect.width(), - mac_util::GetSystemColorSpace(), + base::mac::GetSystemColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); CGContextTranslateCTM(windowless_context_, 0, window_rect.height()); @@ -584,7 +584,7 @@ void WebPluginProxy::SetWindowlessBuffer( window_rect.width(), window_rect.height(), 8, 4 * window_rect.width(), - mac_util::GetSystemColorSpace(), + base::mac::GetSystemColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); CGContextTranslateCTM(background_context_, 0, window_rect.height()); diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index 495a234..9573734 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -40,7 +40,7 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #elif defined(OS_WIN) #include "app/win/iat_patch_function.h" #endif @@ -182,7 +182,7 @@ RenderProcessImpl::RenderProcessImpl() #endif #if defined(OS_MACOSX) - FilePath bundle_path = mac_util::MainAppBundlePath(); + FilePath bundle_path = base::mac::MainAppBundlePath(); initialized_media_library_ = media::InitializeMediaLibrary(bundle_path.Append("Libraries")); diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 68a14ad..b5d6d1f 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -16,7 +16,7 @@ #include "base/file_path.h" #include "base/file_util.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif #include "base/md5.h" #include "base/message_loop.h" @@ -1749,7 +1749,7 @@ void WebPluginDelegatePepper::DrawSkBitmapToCanvas( CGImageCreate( bitmap.width(), bitmap.height(), 8, 32, bitmap.rowBytes(), - mac_util::GetSystemColorSpace(), + base::mac::GetSystemColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, data_provider, NULL, false, kCGRenderingIntentDefault)); diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index a90b265..4c611be 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -42,7 +42,7 @@ #include "sandbox/src/dep.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif #if defined(OS_WIN) @@ -78,7 +78,7 @@ InProcessBrowserTest::InProcessBrowserTest() tab_closeable_state_watcher_enabled_(false), original_single_process_(false) { #if defined(OS_MACOSX) - mac_util::SetOverrideAmIBundled(true); + base::mac::SetOverrideAmIBundled(true); #endif // Before we run the browser, we have to hack the path to the exe to match diff --git a/chrome/test/unit/chrome_test_suite.cc b/chrome/test/unit/chrome_test_suite.cc index 16d7239..07e0932 100644 --- a/chrome/test/unit/chrome_test_suite.cc +++ b/chrome/test/unit/chrome_test_suite.cc @@ -20,7 +20,7 @@ #include "net/base/net_errors.h" #if defined(OS_MACOSX) -#include "base/mac_util.h" +#include "base/mac/mac_util.h" #endif #if defined(OS_POSIX) @@ -107,7 +107,7 @@ void ChromeTestSuite::Initialize() { FilePath path; PathService::Get(base::DIR_EXE, &path); path = path.Append(chrome::kFrameworkName); - mac_util::SetOverrideAppBundlePath(path); + base::mac::SetOverrideAppBundlePath(path); #endif // Force unittests to run using en-US so if we test against string @@ -128,7 +128,7 @@ void ChromeTestSuite::Shutdown() { ResourceBundle::CleanupSharedInstance(); #if defined(OS_MACOSX) - mac_util::SetOverrideAppBundle(NULL); + base::mac::SetOverrideAppBundle(NULL); #endif delete g_browser_process; |