summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/task_helpers.h
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 00:18:08 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 00:18:08 +0000
commit2b78be3c1dd7cc0232aa1a24446a17299d5760e8 (patch)
tree39d8f59495b095b1857be6e908191c76ea13c386 /chrome/browser/cocoa/task_helpers.h
parent00c146f3971938025c5321cc31556ff127aebbc4 (diff)
downloadchromium_src-2b78be3c1dd7cc0232aa1a24446a17299d5760e8.zip
chromium_src-2b78be3c1dd7cc0232aa1a24446a17299d5760e8.tar.gz
chromium_src-2b78be3c1dd7cc0232aa1a24446a17299d5760e8.tar.bz2
Carnitas: Move non-ui Mac files out of browser/ui/cocoa
This is a part of the larger change to remove includes of browser/ui/cocoa/* from code that's outside of browser/ui. upgrade_detector.cc, browser_main.cc, and render_message_filter.cc were including files from browser/ui/cocoa/*. In this case all those files weren't actually UI related so I'm moving this out of browser/ui/cocoa and into browser/cocoa. BUG=None TEST=Compiling Review URL: http://codereview.chromium.org/6312165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/task_helpers.h')
-rw-r--r--chrome/browser/cocoa/task_helpers.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/task_helpers.h b/chrome/browser/cocoa/task_helpers.h
new file mode 100644
index 0000000..ecc40f3
--- /dev/null
+++ b/chrome/browser/cocoa/task_helpers.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_TASK_HELPERS_H_
+#define CHROME_BROWSER_COCOA_TASK_HELPERS_H_
+#pragma once
+
+class Task;
+
+namespace tracked_objects {
+class Location;
+} // namespace tracked_objects
+
+namespace cocoa_utils {
+
+// This can be used in place of BrowserThread::PostTask(BrowserThread::UI, ...).
+// The purpose of this function is to be able to execute Task work alongside
+// native work when a MessageLoop is blocked by a nested run loop. This function
+// will run the Task in both NSEventTrackingRunLoopMode and NSDefaultRunLoopMode
+// for the purpose of executing work while a menu is open. See
+// http://crbug.com/48679 for the full rationale.
+bool PostTaskInEventTrackingRunLoopMode(
+ const tracked_objects::Location& from_here,
+ Task* task);
+
+} // namespace cocoa_utils
+
+#endif // CHROME_BROWSER_COCOA_TASK_HELPERS_H_