OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_THREAD_HELPERS_H_ |
| 6 #define CHROME_BROWSER_UI_THREAD_HELPERS_H_ |
| 7 #pragma once |
| 8 |
| 9 class Task; |
| 10 |
| 11 namespace tracked_objects { |
| 12 class Location; |
| 13 } // namespace tracked_objects |
| 14 |
| 15 namespace ui_thread_helpers { |
| 16 |
| 17 // This can be used in place of ChromeThread::PostTask(ChromeThread::UI, ...). |
| 18 // The purpose of this function is to be able to execute Chrome work alongside |
| 19 // native work when a message loop is running nested or, in the case of Mac, |
| 20 // in a different mode. Currently this is used for updating the HostZoomMap |
| 21 // while the Wrench menu is open, allowing for the zoom display to update. See |
| 22 // http://crbug.com/48679 for the full rationale. |
| 23 // |
| 24 // CAVEAT EMPTOR: This function's implementation is different across platforms |
| 25 // and may run the Task in a way that differs from the stock MessageLoop. You |
| 26 // should check the behavior on all platforms if you use this. |
| 27 bool PostTaskWhileRunningMenu(const tracked_objects::Location& from_here, |
| 28 Task* task); |
| 29 |
| 30 } // namespace ui_thread_helpers |
| 31 |
| 32 #endif // CHROME_BROWSER_UI_THREAD_HELPERS_H_ |
OLD | NEW |