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 #include "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "net/socket/client_socket_factory.h" | 40 #include "net/socket/client_socket_factory.h" |
41 #include "net/socket/tcp_client_socket.h" | 41 #include "net/socket/tcp_client_socket.h" |
42 | 42 |
43 #if defined(USE_AURA) | 43 #if defined(USE_AURA) |
44 #include "content/browser/renderer_host/image_transport_factory.h" | 44 #include "content/browser/renderer_host/image_transport_factory.h" |
45 #endif | 45 #endif |
46 | 46 |
47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
48 #include <windows.h> | 48 #include <windows.h> |
49 #include <commctrl.h> | 49 #include <commctrl.h> |
50 #include <ole2.h> | |
51 #include <shellapi.h> | 50 #include <shellapi.h> |
52 | 51 |
53 #include "content/browser/system_message_window_win.h" | 52 #include "content/browser/system_message_window_win.h" |
54 #include "ui/base/l10n/l10n_util_win.h" | 53 #include "ui/base/l10n/l10n_util_win.h" |
55 #include "net/base/winsock_init.h" | 54 #include "net/base/winsock_init.h" |
56 #endif | 55 #endif |
57 | 56 |
58 #if defined(OS_LINUX) | 57 #if defined(OS_LINUX) |
59 #include "content/browser/media_device_notifications_linux.h" | 58 #include "content/browser/media_device_notifications_linux.h" |
60 #endif | 59 #endif |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 209 } |
211 | 210 |
212 // BrowserMainLoop construction / destruction ============================= | 211 // BrowserMainLoop construction / destruction ============================= |
213 | 212 |
214 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) | 213 BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
215 : parameters_(parameters), | 214 : parameters_(parameters), |
216 parsed_command_line_(parameters.command_line), | 215 parsed_command_line_(parameters.command_line), |
217 result_code_(content::RESULT_CODE_NORMAL_EXIT) { | 216 result_code_(content::RESULT_CODE_NORMAL_EXIT) { |
218 DCHECK(!g_current_browser_main_loop); | 217 DCHECK(!g_current_browser_main_loop); |
219 g_current_browser_main_loop = this; | 218 g_current_browser_main_loop = this; |
220 #if defined(OS_WIN) | |
221 OleInitialize(NULL); | |
222 #endif | |
223 } | 219 } |
224 | 220 |
225 BrowserMainLoop::~BrowserMainLoop() { | 221 BrowserMainLoop::~BrowserMainLoop() { |
226 DCHECK_EQ(this, g_current_browser_main_loop); | 222 DCHECK_EQ(this, g_current_browser_main_loop); |
227 g_current_browser_main_loop = NULL; | 223 g_current_browser_main_loop = NULL; |
228 #if defined(OS_WIN) | |
229 OleUninitialize(); | |
230 #endif | |
231 } | 224 } |
232 | 225 |
233 void BrowserMainLoop::Init() { | 226 void BrowserMainLoop::Init() { |
234 parts_.reset( | 227 parts_.reset( |
235 GetContentClient()->browser()->CreateBrowserMainParts(parameters_)); | 228 GetContentClient()->browser()->CreateBrowserMainParts(parameters_)); |
236 } | 229 } |
237 | 230 |
238 // BrowserMainLoop stages ================================================== | 231 // BrowserMainLoop stages ================================================== |
239 | 232 |
240 void BrowserMainLoop::EarlyInitialization() { | 233 void BrowserMainLoop::EarlyInitialization() { |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 645 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
653 | 646 |
654 #if defined(OS_MACOSX) | 647 #if defined(OS_MACOSX) |
655 MessageLoopForUI::current()->Run(); | 648 MessageLoopForUI::current()->Run(); |
656 #else | 649 #else |
657 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 650 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
658 #endif | 651 #endif |
659 } | 652 } |
660 | 653 |
661 } // namespace content | 654 } // namespace content |
OLD | NEW |