| 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 "ash/shell/content_client/shell_browser_main_parts.h" | 5 #include "ash/shell/content_client/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "ash/shell/shell_delegate_impl.h" | 7 #include "ash/shell/shell_delegate_impl.h" |
| 8 #include "ash/shell/window_watcher.h" | 8 #include "ash/shell/window_watcher.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ui/base/ui_base_paths.h" | 25 #include "ui/base/ui_base_paths.h" |
| 26 #include "ui/compositor/compositor.h" | 26 #include "ui/compositor/compositor.h" |
| 27 #include "ui/compositor/test/compositor_test_support.h" | 27 #include "ui/compositor/test/compositor_test_support.h" |
| 28 #include "ui/views/focus/accelerator_handler.h" | 28 #include "ui/views/focus/accelerator_handler.h" |
| 29 #include "ui/views/test/test_views_delegate.h" | 29 #include "ui/views/test/test_views_delegate.h" |
| 30 | 30 |
| 31 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
| 32 #include "ui/base/touch/touch_factory.h" | 32 #include "ui/base/touch/touch_factory.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) |
| 36 #include "chromeos/dbus/dbus_thread_manager.h" |
| 37 #endif |
| 38 |
| 35 namespace ash { | 39 namespace ash { |
| 36 namespace shell { | 40 namespace shell { |
| 37 void InitWindowTypeLauncher(); | 41 void InitWindowTypeLauncher(); |
| 38 | 42 |
| 39 namespace { | 43 namespace { |
| 40 class ShellViewsDelegate : public views::TestViewsDelegate { | 44 class ShellViewsDelegate : public views::TestViewsDelegate { |
| 41 public: | 45 public: |
| 42 ShellViewsDelegate() {} | 46 ShellViewsDelegate() {} |
| 43 virtual ~ShellViewsDelegate() {} | 47 virtual ~ShellViewsDelegate() {} |
| 44 | 48 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 67 } | 71 } |
| 68 | 72 |
| 69 #if !defined(OS_MACOSX) | 73 #if !defined(OS_MACOSX) |
| 70 void ShellBrowserMainParts::PreMainMessageLoopStart() { | 74 void ShellBrowserMainParts::PreMainMessageLoopStart() { |
| 71 #if defined(OS_LINUX) | 75 #if defined(OS_LINUX) |
| 72 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); | 76 ui::TouchFactory::SetTouchDeviceListFromCommandLine(); |
| 73 #endif | 77 #endif |
| 74 } | 78 } |
| 75 #endif | 79 #endif |
| 76 | 80 |
| 81 void ShellBrowserMainParts::PostMainMessageLoopStart() { |
| 82 #if defined(OS_CHROMEOS) |
| 83 chromeos::DBusThreadManager::Initialize(); |
| 84 #endif |
| 85 } |
| 86 |
| 77 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 87 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 78 browser_context_.reset(new content::ShellBrowserContext); | 88 browser_context_.reset(new content::ShellBrowserContext); |
| 79 | 89 |
| 80 // A ViewsDelegate is required. | 90 // A ViewsDelegate is required. |
| 81 if (!views::ViewsDelegate::views_delegate) | 91 if (!views::ViewsDelegate::views_delegate) |
| 82 views::ViewsDelegate::views_delegate = new ShellViewsDelegate; | 92 views::ViewsDelegate::views_delegate = new ShellViewsDelegate; |
| 83 | 93 |
| 84 ash::shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; | 94 ash::shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; |
| 85 ash::Shell::CreateInstance(delegate); | 95 ash::Shell::CreateInstance(delegate); |
| 86 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); | 96 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 101 aura::Env::DeleteInstance(); | 111 aura::Env::DeleteInstance(); |
| 102 } | 112 } |
| 103 | 113 |
| 104 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 114 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 105 MessageLoopForUI::current()->Run(); | 115 MessageLoopForUI::current()->Run(); |
| 106 return true; | 116 return true; |
| 107 } | 117 } |
| 108 | 118 |
| 109 } // namespace shell | 119 } // namespace shell |
| 110 } // namespace ash | 120 } // namespace ash |
| OLD | NEW |