| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include <windows.h> | 47 #include <windows.h> |
| 48 #include <commctrl.h> | 48 #include <commctrl.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 "content/common/sandbox_policy.h" | 52 #include "content/common/sandbox_policy.h" |
| 53 #include "ui/base/l10n/l10n_util_win.h" | 53 #include "ui/base/l10n/l10n_util_win.h" |
| 54 #include "net/base/winsock_init.h" | 54 #include "net/base/winsock_init.h" |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 #if defined(OS_LINUX) | |
| 58 #include "content/browser/media_device_notifications_linux.h" | |
| 59 #endif | |
| 60 | |
| 61 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 57 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 62 #include <glib-object.h> | 58 #include <glib-object.h> |
| 63 #endif | 59 #endif |
| 64 | 60 |
| 65 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 66 #include <dbus/dbus-glib.h> | 62 #include <dbus/dbus-glib.h> |
| 67 #endif | 63 #endif |
| 68 | 64 |
| 69 #if defined(TOOLKIT_GTK) | 65 #if defined(TOOLKIT_GTK) |
| 70 #include "ui/gfx/gtk_util.h" | 66 #include "ui/gfx/gtk_util.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 | 583 |
| 588 // Register the main thread by instantiating it, but don't call any methods. | 584 // Register the main thread by instantiating it, but don't call any methods. |
| 589 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, | 585 main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, |
| 590 MessageLoop::current())); | 586 MessageLoop::current())); |
| 591 } | 587 } |
| 592 | 588 |
| 593 | 589 |
| 594 void BrowserMainLoop::BrowserThreadsStarted() { | 590 void BrowserMainLoop::BrowserThreadsStarted() { |
| 595 // RDH needs the IO thread to be created. | 591 // RDH needs the IO thread to be created. |
| 596 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl()); | 592 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl()); |
| 597 | |
| 598 #if defined(OS_LINUX) | |
| 599 // MediaDeviceNotificationsLinux needs the File Thread. | |
| 600 const FilePath kDefaultMtabPath("/etc/mtab"); | |
| 601 media_device_notifications_linux_ = | |
| 602 new MediaDeviceNotificationsLinux(kDefaultMtabPath); | |
| 603 media_device_notifications_linux_->Init(); | |
| 604 #endif | |
| 605 } | 593 } |
| 606 | 594 |
| 607 void BrowserMainLoop::InitializeToolkit() { | 595 void BrowserMainLoop::InitializeToolkit() { |
| 608 // TODO(evan): this function is rather subtle, due to the variety | 596 // TODO(evan): this function is rather subtle, due to the variety |
| 609 // of intersecting ifdefs we have. To keep it easy to follow, there | 597 // of intersecting ifdefs we have. To keep it easy to follow, there |
| 610 // are no #else branches on any #ifs. | 598 // are no #else branches on any #ifs. |
| 611 // TODO(stevenjb): Move platform specific code into platform specific Parts | 599 // TODO(stevenjb): Move platform specific code into platform specific Parts |
| 612 // (Need to add InitializeToolkit stage to BrowserParts). | 600 // (Need to add InitializeToolkit stage to BrowserParts). |
| 613 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 601 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 614 // Glib type system initialization. Needed at least for gconf, | 602 // Glib type system initialization. Needed at least for gconf, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); | 637 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); |
| 650 | 638 |
| 651 #if defined(OS_MACOSX) | 639 #if defined(OS_MACOSX) |
| 652 MessageLoopForUI::current()->Run(); | 640 MessageLoopForUI::current()->Run(); |
| 653 #else | 641 #else |
| 654 MessageLoopForUI::current()->RunWithDispatcher(NULL); | 642 MessageLoopForUI::current()->RunWithDispatcher(NULL); |
| 655 #endif | 643 #endif |
| 656 } | 644 } |
| 657 | 645 |
| 658 } // namespace content | 646 } // namespace content |
| OLD | NEW |