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 #include "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 } // namespace | 143 } // namespace |
144 | 144 |
145 namespace content { | 145 namespace content { |
146 | 146 |
147 | 147 |
148 // BrowserMainLoop construction / destructione ============================= | 148 // BrowserMainLoop construction / destructione ============================= |
149 | 149 |
150 BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) | 150 BrowserMainLoop::BrowserMainLoop(const MainFunctionParams& parameters) |
151 : parameters_(parameters), | 151 : parameters_(parameters), |
152 parsed_command_line_(parameters.command_line_), | 152 parsed_command_line_(parameters.command_line), |
153 result_code_(content::RESULT_CODE_NORMAL_EXIT) { | 153 result_code_(content::RESULT_CODE_NORMAL_EXIT) { |
154 #if defined(OS_WIN) | 154 #if defined(OS_WIN) |
155 OleInitialize(NULL); | 155 OleInitialize(NULL); |
156 #endif | 156 #endif |
157 } | 157 } |
158 | 158 |
159 BrowserMainLoop::~BrowserMainLoop() { | 159 BrowserMainLoop::~BrowserMainLoop() { |
160 // Destroy added parts in reverse order. | 160 // Destroy added parts in reverse order. |
161 for (int i = static_cast<int>(parts_list_.size())-1; i >= 0; --i) | 161 for (int i = static_cast<int>(parts_list_.size())-1; i >= 0; --i) |
162 delete parts_list_[i]; | 162 delete parts_list_[i]; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // requirement for gconf. | 322 // requirement for gconf. |
323 g_type_init(); | 323 g_type_init(); |
324 | 324 |
325 #if defined(OS_CHROMEOS) | 325 #if defined(OS_CHROMEOS) |
326 // ChromeOS still uses dbus-glib, so initialize its threading here. | 326 // ChromeOS still uses dbus-glib, so initialize its threading here. |
327 // TODO(satorux, stevenjb): remove this once it is no longer needed. | 327 // TODO(satorux, stevenjb): remove this once it is no longer needed. |
328 dbus_g_thread_init(); | 328 dbus_g_thread_init(); |
329 #endif | 329 #endif |
330 | 330 |
331 #if !defined(USE_AURA) | 331 #if !defined(USE_AURA) |
332 gfx::GtkInitFromCommandLine(parameters_.command_line_); | 332 gfx::GtkInitFromCommandLine(parameters_.command_line); |
333 #endif | 333 #endif |
334 | 334 |
335 SetUpGLibLogHandler(); | 335 SetUpGLibLogHandler(); |
336 #endif | 336 #endif |
337 | 337 |
338 #if defined(TOOLKIT_GTK) | 338 #if defined(TOOLKIT_GTK) |
339 // It is important for this to happen before the first run dialog, as it | 339 // It is important for this to happen before the first run dialog, as it |
340 // styles the dialog as well. | 340 // styles the dialog as well. |
341 gfx::InitRCStyles(); | 341 gfx::InitRCStyles(); |
342 #endif | 342 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
359 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 359 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
360 | 360 |
361 #if defined(OS_MACOSX) | 361 #if defined(OS_MACOSX) |
362 MessageLoopForUI::current()->Run(); | 362 MessageLoopForUI::current()->Run(); |
363 #else | 363 #else |
364 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 364 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
365 #endif | 365 #endif |
366 } | 366 } |
367 | 367 |
368 } // namespace content | 368 } // namespace content |
OLD | NEW |