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/content/shell_content_state.h" | 8 #include "ash/content/shell_content_state.h" |
9 #include "ash/desktop_background/desktop_background_controller.h" | 9 #include "ash/desktop_background/desktop_background_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 ash::ShellInitParams init_params; | 128 ash::ShellInitParams init_params; |
129 init_params.delegate = delegate_; | 129 init_params.delegate = delegate_; |
130 init_params.context_factory = content::GetContextFactory(); | 130 init_params.context_factory = content::GetContextFactory(); |
131 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 131 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
132 ash::Shell::CreateInstance(init_params); | 132 ash::Shell::CreateInstance(init_params); |
133 ash::Shell::GetInstance()->CreateShelf(); | 133 ash::Shell::GetInstance()->CreateShelf(); |
134 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER); | 134 ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER); |
135 | 135 |
136 window_watcher_.reset(new ash::shell::WindowWatcher); | 136 window_watcher_.reset(new ash::shell::WindowWatcher); |
137 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); | 137 gfx::Screen::GetScreen()->AddObserver(window_watcher_.get()); |
138 screen->AddObserver(window_watcher_.get()); | |
139 | 138 |
140 ash::shell::InitWindowTypeLauncher(); | 139 ash::shell::InitWindowTypeLauncher(); |
141 | 140 |
142 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 141 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
143 } | 142 } |
144 | 143 |
145 void ShellBrowserMainParts::PostMainMessageLoopRun() { | 144 void ShellBrowserMainParts::PostMainMessageLoopRun() { |
146 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); | 145 gfx::Screen::GetScreen()->RemoveObserver(window_watcher_.get()); |
147 screen->RemoveObserver(window_watcher_.get()); | |
148 | 146 |
149 window_watcher_.reset(); | 147 window_watcher_.reset(); |
150 delegate_ = nullptr; | 148 delegate_ = nullptr; |
151 ash::Shell::DeleteInstance(); | 149 ash::Shell::DeleteInstance(); |
152 ShellContentState::DestroyInstance(); | 150 ShellContentState::DestroyInstance(); |
153 // The global message center state must be shutdown absent | 151 // The global message center state must be shutdown absent |
154 // g_browser_process. | 152 // g_browser_process. |
155 message_center::MessageCenter::Shutdown(); | 153 message_center::MessageCenter::Shutdown(); |
156 | 154 |
157 #if defined(OS_CHROMEOS) | 155 #if defined(OS_CHROMEOS) |
(...skipping 11 matching lines...) Expand all Loading... |
169 browser_context_.reset(); | 167 browser_context_.reset(); |
170 } | 168 } |
171 | 169 |
172 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 170 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
173 base::MessageLoopForUI::current()->Run(); | 171 base::MessageLoopForUI::current()->Run(); |
174 return true; | 172 return true; |
175 } | 173 } |
176 | 174 |
177 } // namespace shell | 175 } // namespace shell |
178 } // namespace ash | 176 } // namespace ash |
OLD | NEW |