summaryrefslogtreecommitdiffstats
path: root/base/mac_util.mm
Commit message (Collapse)AuthorAgeFilesLines
* Re-land. Fixed previous errors.dimich@chromium.org2010-08-271-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement OSX version for "Start on Login" for background-enabled extensions. When user installs first background-enabled extension we set Chrome to be a hidden "Login Item", and when user uninstalls the last one, we remove Chrome from the "Login Items List". Login Items are the apps that are listed in Systempreferences->Accounts->Login Items, or which have a "Open on Login" check for their Dock icon. Since we manipulate the user-faced UI item here, we try to do it in a way that will likely not interfere with user settings. Most typically, users do not use 'hidden' property, so if we ever encounter setting w/o this property, we won't override. Also there is a hidden preference used to remember the fact that Chrome changed the settings earlier - to avoid override on uninstall of the last persistent app in opposite case. Using the same bit that user can manipulate separately and perhaps even knows about is beneficial since it provides for unified place to "start Chrome on Login" and reduces confusion. Implementation for Login Items List access uses LSSharedFileList API that is available starting 10.5, which I think is our minimal supported version of OSX. BUG=43382 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57569 Reverted Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57614 Reverted Review URL: http://codereview.chromium.org/3163029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57699 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 57614 - Re-land. Fixed previous build error.dimich@chromium.org2010-08-271-149/+0
| | | | | | | | | | | | | | | It looks like it broke browser_tests. Will revert and investigate. Implement OSX version for "Start on Login" for background-enabled extensions. Review URL: http://codereview.chromium.org/3163029 TBR=dimich@chromium.org Review URL: http://codereview.chromium.org/3226002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57625 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land. Fixed previous build error.dimich@chromium.org2010-08-271-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | Implement OSX version for "Start on Login" for background-enabled extensions. When user installs first background-enabled extension we set Chrome to be a hidden "Login Item", and when user uninstalls the last one, we remove Chrome from the "Login Items List". Login Items are the apps that are listed in Systempreferences->Accounts->Login Items, or which have a "Open on Login" check for their Dock icon. Since we manipulate the user-faced UI item here, we try to do it in a way that will likely not interfere with user settings. Most typically, users do not use 'hidden' property, so if we ever encounter setting w/o this property, we won't override. Also there is a hidden preference used to remember the fact that Chrome changed the settings earlier - to avoid override on uninstall of the last persistent app in opposite case. Using the same bit that user can manipulate separately and perhaps even knows about is beneficial since it provides for unified place to "start Chrome on Login" and reduces confusion. Implementation for Login Items List access uses LSSharedFileList API that is available starting 10.5, which I think is our minimal supported version of OSX. BUG=43382 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57569 Reverted, trying to re-land. Review URL: http://codereview.chromium.org/3163029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57614 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 57569 - Implement OSX version for "Start on Login" for ↵dimich@chromium.org2010-08-261-151/+0
| | | | | | | | | | | background-enabled extensions. Review URL: http://codereview.chromium.org/3163029 TBR=dimich@chromium.org Review URL: http://codereview.chromium.org/3130052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57573 0039d316-1c4b-4281-b951-d872f2087c98
* Implement OSX version for "Start on Login" for background-enabled extensions.dimich@chromium.org2010-08-261-0/+151
| | | | | | | | | | | | | | | | | | | | When user installs first bacground-enabled extension we set Chrome to be a "Login Item", and when user uninstalls the last one, we remove Chrome from the "Login Items List". Login Items are the apps that are listed in Systempreferences->Accounts->Login Items, or which have a "Open on Login" check for their Dock icon. Since we manipulate the user-faced UI item here, we try to do it minimally (only on first installed and last uninstalled background app) with understanding that when we have UI for install/uninstall we'll convert this into more visible, cancellable suggestion on that UI. Using the same bit that user can manipulate separately and perhaps even knows about is beneficial since it provides for unified place to "start Chrome on Login" and reduces confusion. The patch also removes SetKeepAlive/EndKeepAlive calls for OSX since on OSX they are already used properly to keep Chrome alive when all windows are closed (in other words, on Mac there is only one behavior that also fits what is needed for background apps) Implementation for Login Items List access uses LSSharedFileList API that is availabel starting 10.5, which I think is our minimal supported version of OSX. Also added a check in BackgroundModeManager::RemoveStatusTrayIcon() which could crash on OSX because there is no icon_tray_ yet. Review URL: http://codereview.chromium.org/3163029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57569 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Revert the diagnostic messages added in r57088.rohitrao@chromium.org2010-08-241-12/+2
| | | | | | | | BUG=52918 TEST=Less log spam. Review URL: http://codereview.chromium.org/3164035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57194 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Add diagnostic logging to AmIBundled() to help with bot failures.rohitrao@chromium.org2010-08-231-3/+16
| | | | | | | | | | This change should be reverted as soon as we figure out what's going wrong. BUG=52918 TEST=None Review URL: http://codereview.chromium.org/3197012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57088 0039d316-1c4b-4281-b951-d872f2087c98
* Move NSImage-to-CGImageRef conversion code into a common helper function in ↵rsesek@chromium.org2010-07-281-0/+33
| | | | | | | | | | | base/mac_util.h. BUG=49571 TEST=Covered by unit_tests. Review URL: http://codereview.chromium.org/3072005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53997 0039d316-1c4b-4281-b951-d872f2087c98
* Commiting http://codereview.chromium.org/2017007/show on behalf of ↵zelidrag@chromium.org2010-05-141-1/+4
| | | | | | | | | | | | | | | | | | | | rkc@chromium.org. This change hooks issue report dialog with Google Feedback backend for ChromeOS. The dialog is going to be used only for Chrome OS at the moment, the previous mechanism is kept intact for other operating systems. Image and System Info reporting is disabled at the moment; for image, we need feedback to get their changes in production, for reporting, the system scripts need to be added (basic Chrome and OS version info is being sent with the report) BUG=chromium-os:2761 TEST=none, work in progress TBR=zelidrag Review URL: http://codereview.chromium.org/2068004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47244 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Force the Process Manager to start up when loading the symbols for ↵thomasvl@chromium.org2010-04-121-0/+9
| | | | | | | | | | process naming. The call seems to use those mach ports, and relying on some other code to start it up seems to be a crap shoot. BUG=40583 TEST=release builds get the renderer, worker, etc. named as such in Activity Monitor. Might also help the Null named processes. Review URL: http://codereview.chromium.org/1589030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44277 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] This probably won't fix the bug complete, but just put in some checks ↵thomasvl@chromium.org2010-04-071-3/+16
| | | | | | | | | | to make sure the process name is only getting set in ways we expect. BUG=40583 TEST=none Review URL: http://codereview.chromium.org/1628007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43867 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: move should-double-click-to-minimize code into mac_util.viettrungluu@chromium.org2010-03-121-0/+13
| | | | | | | | | | | | Also make the fullscreen code do the right thing in theory, even though it doesn't work and I'll probably shortly remove it. BUG=none TEST=Double-clicking on the tab strip should or should not minimize the window according to the system prefs setting; click in the area beside the tabs. Review URL: http://codereview.chromium.org/859004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41413 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] When in fullscreen mode, ties the menubar shown state to the overlay ↵rohitrao@chromium.org2010-03-031-19/+75
| | | | | | | | | | | shown state. BUG=36610 TEST=Go fullscreen. Menubar should only be shown when the overlay is fully visible. TEST=While in fullscreen mode, fullscreen a youtube video. Menubar should be autohidden (mousing to the top of the screen should show it). Review URL: http://codereview.chromium.org/661380 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40529 0039d316-1c4b-4281-b951-d872f2087c98
* Give Mac plugin processes descriptive names for Activity Monitorstuartmorgan@chromium.org2010-02-241-0/+67
| | | | | | | | | BUG=none TEST=Open Activity Monitor, and visit a page with a plugin. The plugin process should show the name of the plugin. Review URL: http://codereview.chromium.org/659007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39950 0039d316-1c4b-4281-b951-d872f2087c98
* Hide/show cursor according to NSCursor requests.avi@chromium.org2010-02-021-0/+7
| | | | | | | | | BUG=http://crbug.com/32703 TEST=when hiding cursor (Flash 10.1), cursor hides (but doesn't stay hidden; that's a different bug) Review URL: http://codereview.chromium.org/560003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37841 0039d316-1c4b-4281-b951-d872f2087c98
* Moved GetUserDirectory() into mac_util.mm.akalin@chromium.org2010-01-271-11/+17
| | | | | | | | | | | | | | | Made mac_util.mm and chrome_paths_mac.mm use GetUserDirectory(). Made firefox_importer_utils_mac.mm use PathService. Added unittests for GetUserDirectory(). BUG=22045 TEST=trybots Review URL: http://codereview.chromium.org/548123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37206 0039d316-1c4b-4281-b951-d872f2087c98
* Add NSTemporaryDirectory() to the list of ignored to catch all possible ↵thomasvl@chromium.org2009-12-301-6/+19
| | | | | | | | | | values. Also handle all the forms of the paths with links resolved. TEST=page cycles, browser_tests all get back to being fast. normal profiles still exclude the files listed in the first bug. BUG=25959,30002 Review URL: http://codereview.chromium.org/523026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35394 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] address perf regressions on botsthomasvl@chromium.org2009-12-301-0/+13
| | | | | | | | | | This isn't the prettiest, but it should get the perf back where we want it. If the file we're asked to exclude is in /var or /private, ignore it. The problem on the bots is the TimeMachine prefs plist is growing unbounded as we keep adding 4 files each run for temporary profiles. The load/modify/write gets slower with each addition. This quick/dirty check to avoid that. Since the original bug for the backup of this data is still open, I figure landing this is the right thing to do until that is fully addressed. BUG=25959,30002 TEST=page cycles, browser_tests all get back to being fast. normal profiles still exclude the files listed in the first bug. Review URL: http://codereview.chromium.org/523024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35382 0039d316-1c4b-4281-b951-d872f2087c98
* Separate ProxyResolverMac and ProxyConfigServiceMac into their own files and ↵hayato@chromium.org2009-12-101-0/+24
| | | | | | | | | | extract common utility functions into other files. TEST=trybot and MacUtilTest in base_unittests BUG=27310 Review URL: http://codereview.chromium.org/463028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34243 0039d316-1c4b-4281-b951-d872f2087c98
* For the immediate milestone, exclude History and Thumbnails from being ↵mrossetti@chromium.org2009-11-111-0/+18
| | | | | | | | | | | backed up by Time Machine. The bug describes appropriate long-term solutions to this problem. BUG=259595 TEST=Launch Chrome. Inspect the following files found in ~/Library/Application Support/Chromium/Default/: a) History, b) History-journal, c) Thumbnails, and d) Thumbnails-journal and verify that they are not being backed up by Time Machine. Review URL: http://codereview.chromium.org/387016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31644 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: Implement about:memory.viettrungluu@chromium.org2009-11-051-0/+49
| | | | | | | | | | | | | | | This implements about:memory on Mac. It calls /bin/ps to obtain information about processes (this is Apple's officially supported "API"). Unfortunately, ps provides fairly minimal information (rss and vsize); top is better, but not a stable API -- it has changed greatly between Mac OS 10.5 and 10.6, and moreover the 10.6 version is more limited in its output formatting. BUG=9653 TEST=Go to about:memory under a variety of conditions (with a variety of browsers loaded). Review URL: http://codereview.chromium.org/333008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31168 0039d316-1c4b-4281-b951-d872f2087c98
* Don't allow the browser to stay above a modal plugin window (Mac)stuartmorgan@chromium.org2009-11-041-0/+10
| | | | | | | | | | | There's a flicker of the modal window being hidden then coming forward again, and the menus still work, so we'll most likely have fake the modality more aggressively at some point. This gets us the basic infrastructure though, and solves the severe usability problem. BUG=20798 TEST=Open a modal plugin window (e.g., Gmail upload). Switch to another app, then back to Chrome; the plugin window should come to the front. Review URL: http://codereview.chromium.org/355021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30965 0039d316-1c4b-4281-b951-d872f2087c98
* Add GrabWindowSnapshot method to mac_util class, and a unit test.mirandac@chromium.org2009-10-271-1/+18
| | | | | | | | BUG= none TEST= none Review URL: http://codereview.chromium.org/333018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30199 0039d316-1c4b-4281-b951-d872f2087c98
* Provide better diagnostics when launching with a silly executable path.mark@chromium.org2009-10-191-3/+4
| | | | | | | | BUG=24842 TEST=none Review URL: http://codereview.chromium.org/304004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29442 0039d316-1c4b-4281-b951-d872f2087c98
* Change Mac fullscreen mode to be a stack, not a flag. This fixes crashes andamanda@chromium.org2009-10-111-0/+22
| | | | | | | | | | | | | misbehavior of fullscreen browser windows and plugins, especially when they interact. BUG=23571,24216 TEST=open up multiple browser windows, make them fullscreen, and go to pages (such as video players) that can invoke full screen plugins. The menu bar should hide when the first window becomes fullscreen, show again after the last window stops being fullscreen, and not crash at any of those transitions. Review URL: http://codereview.chromium.org/269022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28690 0039d316-1c4b-4281-b951-d872f2087c98
* Move all resources into the framework.mark@chromium.org2009-10-071-0/+5
| | | | | | | | | | | | | | BUG=14610 (in support of unbreaking auto-update) TEST=The .app's Contents/Resources folder should not contain the resources that are moving to the .framework's Resources folder; The .app's Contents/Resources folder should still contain app.icns, document.icns, the helper .app, and a whole slew of .lprojs that only contain InfoPlist.strings; Make sure Breakpad still works in the browser, renderer, and other process types. Review URL: http://codereview.chromium.org/256062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28262 0039d316-1c4b-4281-b951-d872f2087c98
* For the purposes of the "system color space," use the main display's colormark@chromium.org2009-09-131-9/+13
| | | | | | | | | | | space instead of a color space derived from the apparently unreliable system ColorSync profile setting. BUG=21658 TEST=Rendering works on Nico's girlfriend's laptop Review URL: http://codereview.chromium.org/194096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26090 0039d316-1c4b-4281-b951-d872f2087c98
* Adjust color spaces so that Mac Chrome renders colors properly.amanda@chromium.org2009-09-031-0/+24
| | | | | | | | | | | BUG=19951,20552 TEST=compare pages rendered in Chromium and Safari. They should appear the same. mark: review jrg/brettw: FYI Review URL: http://codereview.chromium.org/194013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25380 0039d316-1c4b-4281-b951-d872f2087c98
* Check the right Info.plist to determine whether the app is the browser or amark@chromium.org2009-09-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | background helper. This fixes the Breakpad about:crash problem, but not directly. I'm not exactly sure of the failure mechanism here. It's likely that doing this call properly here caches the Info.plist dictionary, and that something in Breakpad crashes when that's not done. Without this fix, we're seeing a double fault, with the second exception occurring in the renderer while it is processing the crash. Likely because of the use of fork && execv instead of posix_spawn to launch the renderer, the second exception is delivered to the browser process. The browser's Breakpad instance recognizes that the exception is not its own, but attempts to act on it in part anyway. There may be a Breakpad bug here, I'll investigate more tomorrow. BUG=20371 TEST=In a Breakpad-enabled build, about:crash should bring up a sad tab and not crash the browser process Review URL: http://codereview.chromium.org/194007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25311 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Breakpad-enabled builds on the Mac.mark@chromium.org2009-09-011-2/+1
| | | | | | | | | | | | | | | | | | | .../src/chrome/app/breakpad_mac.mm: In function ‘void InitCrashReporter()’: .../src/chrome/app/breakpad_mac.mm:56: error: ‘parsed_command_line’ was not declared in this scope IMPORTANT NOTE: When you're making changes to files that aren't part of the normal build, you MUST test them. The next time I see an obvious case of "oops, I never actually built that file," I'm just going to back it out. As for this instance, I'm fixing it now, but you MUST build and test your change locally. We can't afford accidentally losing Breakpad coverage. I've already seen an embarrassing number of instances of "oops, Breakpad's broken" but we've fortunately caught them all before integrating them into a release. BUG=It doesn't build TEST=Does it build now? Review URL: http://codereview.chromium.org/178056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25041 0039d316-1c4b-4281-b951-d872f2087c98
* Change when we enable Apple's Crash reporter.jeremy@chromium.org2009-08-311-0/+7
| | | | | | | | | | | | | | | | | | | | Enable Apple Crash Reporter for Browser process in Non-Debug builds. * Introduce mac_util::IsBackgroundProcess(). * Invert logic around Breakpad Enabling/Disabling to make it clearer. * Honor the kDisableBreakpad switch. Our new policy: * Breakpad is enabled/disabled based on the user stats reporting opt-in flag - this hasn't changed. * Always disable Apple Crash in background processes (plug-in, renderer, etc). * If Breakpad is enabled browser crashes will be passed to Crash Reporter. * If Breakpad is NOT enabled browser [or any other foreground app] crashes will be passed to Crash Reporter in Release builds. Effectively this means that we now enable Crash Reporter for the browser process in Chromium release builds so these will no longer crash silently with no trace. Review URL: http://codereview.chromium.org/180048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24959 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that CreatorCodeForCFBundleRef returns the "unknown" creator code frommark@chromium.org2009-08-121-1/+1
| | | | | | | | | initialized data even if the system is totally unable to service the request. BUG=19000 Review URL: http://codereview.chromium.org/164388 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23185 0039d316-1c4b-4281-b951-d872f2087c98
* Use real creator code for Keychain items. Instead of hard-coding 'rimZ', usemark@chromium.org2009-08-111-13/+29
| | | | | | | | | | | the correct creator code for the application. This is 'rimZ' for branded Google Chrome, and 'Cr24' for Chromium. BUG=19000 TEST=No functional change in Google Chrome-branded builds Review URL: http://codereview.chromium.org/164332 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23074 0039d316-1c4b-4281-b951-d872f2087c98
* First cut at Safari Import - Home Page & History Only.jeremy@chromium.org2009-07-311-0/+14
| | | | | | Review URL: http://codereview.chromium.org/159668 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22179 0039d316-1c4b-4281-b951-d872f2087c98
* Add a macutil for the main app bundle and overridethomasvl@chromium.org2009-03-031-0/+25
| | | | | | | | | | | | - provide apis to get and override the app bundle - w/in the core code, use this api for fetching the bundle - render sandbox config - resource bundles - test shell font - w/in the unittest boot straps, use the mac util to override the bundle so resources can be found. Review URL: http://codereview.chromium.org/28214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10798 0039d316-1c4b-4281-b951-d872f2087c98
* Load the Ahem font from the source tree when not running bundled, formark@chromium.org2008-12-101-0/+18
| | | | | | | test_shell_tests. Review URL: http://codereview.chromium.org/13719 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6738 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup of the path service. (With some extra utilities to be used later.)avi@google.com2008-12-091-0/+26
Review URL: http://codereview.chromium.org/13260 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6584 0039d316-1c4b-4281-b951-d872f2087c98