| 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 #ifndef CONTENT_BROWSER_BROWSER_MAIN_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_MAIN_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_MAIN_H_ | 6 #define CONTENT_BROWSER_BROWSER_MAIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 explicit BrowserMainParts(const MainFunctionParams& parameters); | 72 explicit BrowserMainParts(const MainFunctionParams& parameters); |
| 73 virtual ~BrowserMainParts(); | 73 virtual ~BrowserMainParts(); |
| 74 | 74 |
| 75 // Parts to be called by |BrowserMain()|. | 75 // Parts to be called by |BrowserMain()|. |
| 76 void EarlyInitialization(); | 76 void EarlyInitialization(); |
| 77 void InitializeToolkit(); | 77 void InitializeToolkit(); |
| 78 void MainMessageLoopStart(); | 78 void MainMessageLoopStart(); |
| 79 void RunMainMessageLoopParts(); | 79 void RunMainMessageLoopParts(); |
| 80 | 80 |
| 81 int result_code() const { return result_code_; } | 81 int result_code() const { return result_code_; } |
| 82 const MainFunctionParams& parameters() const { return parameters_; } |
| 83 const CommandLine& parsed_command_line() const { |
| 84 return parsed_command_line_; |
| 85 } |
| 82 | 86 |
| 83 protected: | 87 protected: |
| 84 // Methods to be overridden to provide platform-specific code; these | 88 // Methods to be overridden to provide platform-specific code; these |
| 85 // correspond to the "parts" above. | 89 // correspond to the "parts" above. |
| 86 virtual void PreEarlyInitialization(); | 90 virtual void PreEarlyInitialization(); |
| 87 virtual void PostEarlyInitialization(); | 91 virtual void PostEarlyInitialization(); |
| 88 virtual void PreMainMessageLoopStart(); | 92 virtual void PreMainMessageLoopStart(); |
| 89 virtual void PostMainMessageLoopStart(); | 93 virtual void PostMainMessageLoopStart(); |
| 90 virtual void PreMainMessageLoopRun(); | 94 virtual void PreMainMessageLoopRun(); |
| 91 virtual void MainMessageLoopRun(); | 95 virtual void MainMessageLoopRun(); |
| 92 virtual void PostMainMessageLoopRun(); | 96 virtual void PostMainMessageLoopRun(); |
| 93 | 97 |
| 94 // Allows an embedder to do any extra toolkit initialization. | 98 // Allows an embedder to do any extra toolkit initialization. |
| 95 virtual void ToolkitInitialized(); | 99 virtual void ToolkitInitialized(); |
| 96 | 100 |
| 97 // Accessors for data members (below) ---------------------------------------- | 101 // Accessors for data members (below) ---------------------------------------- |
| 98 const MainFunctionParams& parameters() const { | |
| 99 return parameters_; | |
| 100 } | |
| 101 const CommandLine& parsed_command_line() const { | |
| 102 return parsed_command_line_; | |
| 103 } | |
| 104 MessageLoop& main_message_loop() const { | 102 MessageLoop& main_message_loop() const { |
| 105 return *main_message_loop_; | 103 return *main_message_loop_; |
| 106 } | 104 } |
| 107 void set_result_code(int result_code) { result_code_ = result_code; } | 105 void set_result_code(int result_code) { result_code_ = result_code; } |
| 108 | 106 |
| 109 private: | 107 private: |
| 110 void InitializeMainThread(); | 108 void InitializeMainThread(); |
| 111 | 109 |
| 112 // Members initialized on construction --------------------------------------- | 110 // Members initialized on construction --------------------------------------- |
| 113 | 111 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 125 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 123 DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 bool ExitedMainMessageLoop(); | 126 bool ExitedMainMessageLoop(); |
| 129 | 127 |
| 130 } // namespace content | 128 } // namespace content |
| 131 | 129 |
| 132 CONTENT_EXPORT int BrowserMain(const MainFunctionParams& parameters); | 130 CONTENT_EXPORT int BrowserMain(const MainFunctionParams& parameters); |
| 133 | 131 |
| 134 #endif // CONTENT_BROWSER_BROWSER_MAIN_H_ | 132 #endif // CONTENT_BROWSER_BROWSER_MAIN_H_ |
| OLD | NEW |