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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include <windows.h> | 46 #include <windows.h> |
47 #include <commctrl.h> | 47 #include <commctrl.h> |
48 #include <ole2.h> | 48 #include <ole2.h> |
49 #include <shellapi.h> | 49 #include <shellapi.h> |
50 | 50 |
51 #include "content/browser/system_message_window_win.h" | 51 #include "content/browser/system_message_window_win.h" |
52 #include "ui/base/l10n/l10n_util_win.h" | 52 #include "ui/base/l10n/l10n_util_win.h" |
53 #include "net/base/winsock_init.h" | 53 #include "net/base/winsock_init.h" |
54 #endif | 54 #endif |
55 | 55 |
56 #if defined(OS_MACOSX) | |
57 #include "content/browser/mac/media_device_notifications.h" | |
58 #endif | |
59 | |
60 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 56 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
61 #include <glib-object.h> | 57 #include <glib-object.h> |
62 #endif | 58 #endif |
63 | 59 |
64 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
65 #include <dbus/dbus-glib.h> | 61 #include <dbus/dbus-glib.h> |
66 #endif | 62 #endif |
67 | 63 |
68 #if defined(TOOLKIT_USES_GTK) | 64 #if defined(TOOLKIT_USES_GTK) |
69 #include "ui/gfx/gtk_util.h" | 65 #include "ui/gfx/gtk_util.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 TraceController::GetInstance()->InitStartupTracing(parsed_command_line_); | 320 TraceController::GetInstance()->InitStartupTracing(parsed_command_line_); |
325 | 321 |
326 system_monitor_.reset(new base::SystemMonitor); | 322 system_monitor_.reset(new base::SystemMonitor); |
327 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 323 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
328 | 324 |
329 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 325 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
330 audio_manager_.reset(AudioManager::Create()); | 326 audio_manager_.reset(AudioManager::Create()); |
331 | 327 |
332 #if defined(OS_WIN) | 328 #if defined(OS_WIN) |
333 system_message_window_.reset(new SystemMessageWindowWin); | 329 system_message_window_.reset(new SystemMessageWindowWin); |
334 #elif defined(OS_MACOSX) | |
335 StartMediaDeviceNotifications(); | |
336 #endif | 330 #endif |
337 | 331 |
338 // Prior to any processing happening on the io thread, we create the | 332 // Prior to any processing happening on the io thread, we create the |
339 // plugin service as it is predominantly used from the io thread, | 333 // plugin service as it is predominantly used from the io thread, |
340 // but must be created on the main thread. The service ctor is | 334 // but must be created on the main thread. The service ctor is |
341 // inexpensive and does not invoke the io_thread() accessor. | 335 // inexpensive and does not invoke the io_thread() accessor. |
342 PluginService::GetInstance()->Init(); | 336 PluginService::GetInstance()->Init(); |
343 | 337 |
344 if (parts_.get()) | 338 if (parts_.get()) |
345 parts_->PostMainMessageLoopStart(); | 339 parts_->PostMainMessageLoopStart(); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 628 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
635 | 629 |
636 #if defined(OS_MACOSX) | 630 #if defined(OS_MACOSX) |
637 MessageLoopForUI::current()->Run(); | 631 MessageLoopForUI::current()->Run(); |
638 #else | 632 #else |
639 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 633 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
640 #endif | 634 #endif |
641 } | 635 } |
642 | 636 |
643 } // namespace content | 637 } // namespace content |
OLD | NEW |