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" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ash::Shell::CreateInstance(delegate_); | 125 ash::Shell::CreateInstance(delegate_); |
126 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); | 126 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); |
127 | 127 |
128 window_watcher_.reset(new ash::shell::WindowWatcher); | 128 window_watcher_.reset(new ash::shell::WindowWatcher); |
129 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); | 129 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); |
130 screen->AddObserver(window_watcher_.get()); | 130 screen->AddObserver(window_watcher_.get()); |
131 delegate_->SetWatcher(window_watcher_.get()); | 131 delegate_->SetWatcher(window_watcher_.get()); |
132 | 132 |
133 ash::shell::InitWindowTypeLauncher(); | 133 ash::shell::InitWindowTypeLauncher(); |
134 | 134 |
135 DesktopBackgroundController* controller = | 135 Shell::GetInstance()->desktop_background_controller()->SetDefaultWallpaper( |
136 Shell::GetInstance()->desktop_background_controller(); | 136 false /* is_guest */); |
137 if (controller->GetAppropriateResolution() == WALLPAPER_RESOLUTION_LARGE) | |
138 controller->SetDefaultWallpaper(kDefaultLargeWallpaper); | |
139 else | |
140 controller->SetDefaultWallpaper(kDefaultSmallWallpaper); | |
141 | 137 |
142 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 138 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
143 } | 139 } |
144 | 140 |
145 void ShellBrowserMainParts::PostMainMessageLoopRun() { | 141 void ShellBrowserMainParts::PostMainMessageLoopRun() { |
146 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); | 142 gfx::Screen* screen = Shell::GetInstance()->GetScreen(); |
147 screen->RemoveObserver(window_watcher_.get()); | 143 screen->RemoveObserver(window_watcher_.get()); |
148 | 144 |
149 window_watcher_.reset(); | 145 window_watcher_.reset(); |
150 delegate_->SetWatcher(NULL); | 146 delegate_->SetWatcher(NULL); |
(...skipping 18 matching lines...) Expand all Loading... |
169 browser_context_.reset(); | 165 browser_context_.reset(); |
170 } | 166 } |
171 | 167 |
172 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 168 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
173 base::MessageLoopForUI::current()->Run(); | 169 base::MessageLoopForUI::current()->Run(); |
174 return true; | 170 return true; |
175 } | 171 } |
176 | 172 |
177 } // namespace shell | 173 } // namespace shell |
178 } // namespace ash | 174 } // namespace ash |
OLD | NEW |