OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 | 12 |
| 13 class MessageLoop; |
| 14 |
13 namespace content { | 15 namespace content { |
14 | 16 |
15 // This class contains different "stages" to be executed by |BrowserMain()|, | 17 // This class contains different "stages" to be executed by |BrowserMain()|, |
16 // Each stage is represented by a single BrowserMainParts method, called from | 18 // Each stage is represented by a single BrowserMainParts method, called from |
17 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization()) | 19 // the corresponding method in |BrowserMainLoop| (e.g., EarlyInitialization()) |
18 // which does the following: | 20 // which does the following: |
19 // - calls a method (e.g., "PreEarlyInitialization()") which implements | 21 // - calls a method (e.g., "PreEarlyInitialization()") which implements |
20 // platform / tookit specific code for that stage. | 22 // platform / tookit specific code for that stage. |
21 // - calls various methods for things common to all platforms (for that stage). | 23 // - calls various methods for things common to all platforms (for that stage). |
22 // - calls a method (e.g., "PostEarlyInitialization()") for platform-specific | 24 // - calls a method (e.g., "PostEarlyInitialization()") for platform-specific |
(...skipping 30 matching lines...) Expand all Loading... |
53 public: | 55 public: |
54 BrowserMainParts() {} | 56 BrowserMainParts() {} |
55 virtual ~BrowserMainParts() {} | 57 virtual ~BrowserMainParts() {} |
56 | 58 |
57 virtual void PreEarlyInitialization() = 0; | 59 virtual void PreEarlyInitialization() = 0; |
58 | 60 |
59 virtual void PostEarlyInitialization() = 0; | 61 virtual void PostEarlyInitialization() = 0; |
60 | 62 |
61 virtual void PreMainMessageLoopStart() = 0; | 63 virtual void PreMainMessageLoopStart() = 0; |
62 | 64 |
| 65 // Return the main message loop object or NULL to use the default message |
| 66 // loop object. |
| 67 virtual MessageLoop* GetMainMessageLoop() = 0; |
| 68 |
63 virtual void PostMainMessageLoopStart() = 0; | 69 virtual void PostMainMessageLoopStart() = 0; |
64 | 70 |
65 // Allows an embedder to do any extra toolkit initialization. | 71 // Allows an embedder to do any extra toolkit initialization. |
66 virtual void ToolkitInitialized() = 0; | 72 virtual void ToolkitInitialized() = 0; |
67 | 73 |
68 // Called just before any child threads owned by the content | 74 // Called just before any child threads owned by the content |
69 // framework are created. | 75 // framework are created. |
70 // | 76 // |
71 // The main message loop has been started at this point (but has not | 77 // The main message loop has been started at this point (but has not |
72 // been run), and the toolkit has been initialized. Returns the error code | 78 // been run), and the toolkit has been initialized. Returns the error code |
(...skipping 17 matching lines...) Expand all Loading... |
90 // stopped and destroyed. | 96 // stopped and destroyed. |
91 virtual void PostDestroyThreads() = 0; | 97 virtual void PostDestroyThreads() = 0; |
92 | 98 |
93 private: | 99 private: |
94 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 100 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); |
95 }; | 101 }; |
96 | 102 |
97 } // namespace content | 103 } // namespace content |
98 | 104 |
99 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ | 105 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |