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