| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell/shell_delegate_impl.h" | 10 #include "ash/shell/shell_delegate_impl.h" |
| 11 #include "ash/shell/window_watcher.h" | 11 #include "ash/shell/window_watcher.h" |
| 12 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/i18n/icu_util.h" | 15 #include "base/i18n/icu_util.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
| 20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
| 21 #include "content/shell/browser/shell_browser_context.h" | 21 #include "content/shell/browser/shell_browser_context.h" |
| 22 #include "content/shell/browser/shell_net_log.h" | 22 #include "content/shell/browser/shell_net_log.h" |
| 23 #include "net/base/net_module.h" | 23 #include "net/base/net_module.h" |
| 24 #include "ui/aura/env.h" | 24 #include "ui/aura/env.h" |
| 25 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 26 #include "ui/aura/window_tree_host.h" | 26 #include "ui/aura/window_tree_host.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "ui/base/ui_base_paths.h" | 28 #include "ui/base/ui_base_paths.h" |
| 29 #include "ui/compositor/compositor.h" | 29 #include "ui/compositor/compositor.h" |
| 30 #include "ui/events/platform/platform_event_source.h" |
| 30 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
| 31 #include "ui/message_center/message_center.h" | 32 #include "ui/message_center/message_center.h" |
| 32 #include "ui/views/test/test_views_delegate.h" | 33 #include "ui/views/test/test_views_delegate.h" |
| 33 #include "ui/wm/core/wm_state.h" | 34 #include "ui/wm/core/wm_state.h" |
| 34 | 35 |
| 35 #if defined(USE_X11) | 36 #if defined(USE_X11) |
| 36 #include "ui/events/x/touch_factory_x11.h" | 37 #include "ui/events/x/touch_factory_x11.h" |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 100 |
| 100 void ShellBrowserMainParts::ToolkitInitialized() { | 101 void ShellBrowserMainParts::ToolkitInitialized() { |
| 101 wm_state_.reset(new wm::WMState); | 102 wm_state_.reset(new wm::WMState); |
| 102 } | 103 } |
| 103 | 104 |
| 104 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 105 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 105 net_log_.reset(new content::ShellNetLog("ash_shell")); | 106 net_log_.reset(new content::ShellNetLog("ash_shell")); |
| 106 browser_context_.reset(new content::ShellBrowserContext( | 107 browser_context_.reset(new content::ShellBrowserContext( |
| 107 false, net_log_.get())); | 108 false, net_log_.get())); |
| 108 | 109 |
| 110 event_source_ = ui::PlatformEventSource::CreateDefault(); |
| 111 |
| 109 // A ViewsDelegate is required. | 112 // A ViewsDelegate is required. |
| 110 if (!views::ViewsDelegate::views_delegate) | 113 if (!views::ViewsDelegate::views_delegate) |
| 111 views::ViewsDelegate::views_delegate = new ShellViewsDelegate; | 114 views::ViewsDelegate::views_delegate = new ShellViewsDelegate; |
| 112 | 115 |
| 113 delegate_ = new ash::shell::ShellDelegateImpl; | 116 delegate_ = new ash::shell::ShellDelegateImpl; |
| 114 // The global message center state must be initialized absent | 117 // The global message center state must be initialized absent |
| 115 // g_browser_process. | 118 // g_browser_process. |
| 116 message_center::MessageCenter::Initialize(); | 119 message_center::MessageCenter::Initialize(); |
| 117 | 120 |
| 118 #if defined(OS_CHROMEOS) | 121 #if defined(OS_CHROMEOS) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 browser_context_.reset(); | 168 browser_context_.reset(); |
| 166 } | 169 } |
| 167 | 170 |
| 168 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 171 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 169 base::MessageLoopForUI::current()->Run(); | 172 base::MessageLoopForUI::current()->Run(); |
| 170 return true; | 173 return true; |
| 171 } | 174 } |
| 172 | 175 |
| 173 } // namespace shell | 176 } // namespace shell |
| 174 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |