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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 TraceController::GetInstance()->InitStartupTracing(parsed_command_line_); | 326 TraceController::GetInstance()->InitStartupTracing(parsed_command_line_); |
323 | 327 |
324 system_monitor_.reset(new base::SystemMonitor); | 328 system_monitor_.reset(new base::SystemMonitor); |
325 hi_res_timer_manager_.reset(new HighResolutionTimerManager); | 329 hi_res_timer_manager_.reset(new HighResolutionTimerManager); |
326 | 330 |
327 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 331 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
328 audio_manager_.reset(AudioManager::Create()); | 332 audio_manager_.reset(AudioManager::Create()); |
329 | 333 |
330 #if defined(OS_WIN) | 334 #if defined(OS_WIN) |
331 system_message_window_.reset(new SystemMessageWindowWin); | 335 system_message_window_.reset(new SystemMessageWindowWin); |
| 336 #elif defined(OS_MACOSX) |
| 337 StartMediaDeviceNotifications(); |
332 #endif | 338 #endif |
333 | 339 |
334 // Prior to any processing happening on the io thread, we create the | 340 // Prior to any processing happening on the io thread, we create the |
335 // plugin service as it is predominantly used from the io thread, | 341 // plugin service as it is predominantly used from the io thread, |
336 // but must be created on the main thread. The service ctor is | 342 // but must be created on the main thread. The service ctor is |
337 // inexpensive and does not invoke the io_thread() accessor. | 343 // inexpensive and does not invoke the io_thread() accessor. |
338 PluginService::GetInstance()->Init(); | 344 PluginService::GetInstance()->Init(); |
339 | 345 |
340 if (parts_.get()) | 346 if (parts_.get()) |
341 parts_->PostMainMessageLoopStart(); | 347 parts_->PostMainMessageLoopStart(); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 636 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
631 | 637 |
632 #if defined(OS_MACOSX) | 638 #if defined(OS_MACOSX) |
633 MessageLoopForUI::current()->Run(); | 639 MessageLoopForUI::current()->Run(); |
634 #else | 640 #else |
635 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 641 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
636 #endif | 642 #endif |
637 } | 643 } |
638 | 644 |
639 } // namespace content | 645 } // namespace content |
OLD | NEW |