OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Contains functions used by BrowserMain() that are gtk-specific. | 5 // Contains functions used by BrowserMain() that are gtk-specific. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_X11_H_ | 7 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_EXTRA_PARTS_X11_H_ |
8 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_X11_H_ | 8 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_EXTRA_PARTS_X11_H_ |
9 | 9 |
10 // Installs the X11 error handlers for the browser process used during | 10 #include "base/basictypes.h" |
11 // startup. They simply print error messages and exit because | 11 #include "base/compiler_specific.h" |
12 // we can't shutdown properly while creating and initializing services. | 12 #include "chrome/browser/chrome_browser_main_extra_parts.h" |
13 void SetBrowserX11ErrorHandlersPreEarlyInitialization(); | |
14 | 13 |
15 // Installs the X11 error handlers for the browser process after the | 14 class ChromeBrowserMainExtraPartsX11 : public ChromeBrowserMainExtraParts { |
16 // main message loop has started. This will allow us to exit cleanly | 15 public: |
17 // if X exits before us. | 16 ChromeBrowserMainExtraPartsX11(); |
18 void SetBrowserX11ErrorHandlersPostMainMessageLoopStart(); | 17 virtual ~ChromeBrowserMainExtraPartsX11(); |
19 | 18 |
20 // Installs empty X11 error handlers. This avoids calling into the message-loop | 19 private: |
21 // in case an X11 erro happens while the message-loop is being destroyed. | 20 // ChromeBrowserMainExtraParts overrides. |
22 void UnsetBrowserX11ErrorHandlers(); | 21 virtual void PreEarlyInitialization() OVERRIDE; |
| 22 virtual void PostMainMessageLoopStart() OVERRIDE; |
| 23 virtual void PostMainMessageLoopRun() OVERRIDE; |
23 | 24 |
24 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_X11_H_ | 25 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsX11); |
| 26 }; |
| 27 |
| 28 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_EXTRA_PARTS_X11_H_ |
OLD | NEW |