| 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/shell_init_params.h" |
| 12 #include "ash/system/user/login_status.h" | 13 #include "ash/system/user/login_status.h" |
| 13 #include "base/bind.h" | 14 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/i18n/icu_util.h" | 16 #include "base/i18n/icu_util.h" |
| 16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 17 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 19 #include "base/threading/thread_restrictions.h" | 20 #include "base/threading/thread_restrictions.h" |
| 20 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 21 #include "content/shell/browser/shell_browser_context.h" | 22 #include "content/shell/browser/shell_browser_context.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // The global message center state must be initialized absent | 115 // The global message center state must be initialized absent |
| 115 // g_browser_process. | 116 // g_browser_process. |
| 116 message_center::MessageCenter::Initialize(); | 117 message_center::MessageCenter::Initialize(); |
| 117 | 118 |
| 118 #if defined(OS_CHROMEOS) | 119 #if defined(OS_CHROMEOS) |
| 119 // Create CrasAudioHandler for testing since g_browser_process | 120 // Create CrasAudioHandler for testing since g_browser_process |
| 120 // is absent. | 121 // is absent. |
| 121 chromeos::CrasAudioHandler::InitializeForTesting(); | 122 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 122 #endif | 123 #endif |
| 123 | 124 |
| 124 ash::Shell::CreateInstance(delegate_); | 125 ash::ShellInitParams init_params; |
| 126 init_params.delegate = delegate_; |
| 127 ash::Shell::CreateInstance(init_params); |
| 125 delegate_->set_browser_context(browser_context_.get()); | 128 delegate_->set_browser_context(browser_context_.get()); |
| 126 ash::Shell::GetInstance()->CreateShelf(); | 129 ash::Shell::GetInstance()->CreateShelf(); |
| 127 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange( | 130 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange( |
| 128 user::LOGGED_IN_USER); | 131 user::LOGGED_IN_USER); |
| 129 | 132 |
| 130 window_watcher_.reset(new ash::shell::WindowWatcher); | 133 window_watcher_.reset(new ash::shell::WindowWatcher); |
| 131 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); | 134 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); |
| 132 screen->AddObserver(window_watcher_.get()); | 135 screen->AddObserver(window_watcher_.get()); |
| 133 delegate_->SetWatcher(window_watcher_.get()); | 136 delegate_->SetWatcher(window_watcher_.get()); |
| 134 | 137 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 162 browser_context_.reset(); | 165 browser_context_.reset(); |
| 163 } | 166 } |
| 164 | 167 |
| 165 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 168 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 166 base::MessageLoopForUI::current()->Run(); | 169 base::MessageLoopForUI::current()->Run(); |
| 167 return true; | 170 return true; |
| 168 } | 171 } |
| 169 | 172 |
| 170 } // namespace shell | 173 } // namespace shell |
| 171 } // namespace ash | 174 } // namespace ash |
| OLD | NEW |