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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 // requirement for gconf. | 325 // requirement for gconf. |
326 g_type_init(); | 326 g_type_init(); |
327 | 327 |
328 #if defined(OS_CHROMEOS) | 328 #if defined(OS_CHROMEOS) |
329 // ChromeOS still uses dbus-glib, so initialize its threading here. | 329 // ChromeOS still uses dbus-glib, so initialize its threading here. |
330 // TODO(satorux, stevenjb): remove this once it is no longer needed. | 330 // TODO(satorux, stevenjb): remove this once it is no longer needed. |
331 dbus_g_thread_init(); | 331 dbus_g_thread_init(); |
332 #endif | 332 #endif |
333 | 333 |
334 #if !defined(USE_AURA) | 334 #if !defined(USE_AURA) |
335 gfx::GtkInitFromCommandLine(parameters_.command_line_); | 335 gfx::GtkInitFromCommandLine(parameters_.command_line); |
336 #endif | 336 #endif |
337 | 337 |
338 SetUpGLibLogHandler(); | 338 SetUpGLibLogHandler(); |
339 #endif | 339 #endif |
340 | 340 |
341 #if defined(TOOLKIT_GTK) | 341 #if defined(TOOLKIT_GTK) |
342 // It is important for this to happen before the first run dialog, as it | 342 // It is important for this to happen before the first run dialog, as it |
343 // styles the dialog as well. | 343 // styles the dialog as well. |
344 gfx::InitRCStyles(); | 344 gfx::InitRCStyles(); |
345 #endif | 345 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
362 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); | 362 MessageLoopForUI::current()->PostTask(FROM_HERE, parameters_.ui_task); |
363 | 363 |
364 #if defined(OS_MACOSX) | 364 #if defined(OS_MACOSX) |
365 MessageLoopForUI::current()->Run(); | 365 MessageLoopForUI::current()->Run(); |
366 #else | 366 #else |
367 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 367 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
368 #endif | 368 #endif |
369 } | 369 } |
370 | 370 |
371 } // namespace content | 371 } // namespace content |
OLD | NEW |