Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1750)

Unified Diff: base/mac/mac_util.mm

Issue 7215040: Fix relaunches on the Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/mac/mac_util.mm
===================================================================
--- base/mac/mac_util.mm (revision 90369)
+++ base/mac/mac_util.mm (working copy)
@@ -242,6 +242,26 @@
}
}
+bool AmIForeground() {
+ ProcessSerialNumber foreground_psn = { 0 };
+ OSErr err = GetFrontProcess(&foreground_psn);
+ if (err != noErr) {
+ LOG(WARNING) << "GetFrontProcess: " << err;
+ return false;
+ }
+
+ ProcessSerialNumber my_psn = { 0, kCurrentProcess };
+
+ Boolean result = FALSE;
+ err = SameProcess(&foreground_psn, &my_psn, &result);
+ if (err != noErr) {
+ LOG(WARNING) << "SameProcess: " << err;
+ return false;
+ }
+
+ return result;
+}
+
bool SetFileBackupExclusion(const FilePath& file_path) {
NSString* file_path_ns =
[NSString stringWithUTF8String:file_path.value().c_str()];
« no previous file with comments | « base/mac/mac_util.h ('k') | chrome/app/chrome_main.cc » ('j') | chrome/common/chrome_switches.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698