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/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell/shell_delegate_impl.h" | 9 #include "ash/shell/shell_delegate_impl.h" |
10 #include "ash/shell/window_watcher.h" | 10 #include "ash/shell/window_watcher.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 ash::shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; | 96 ash::shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; |
97 ash::Shell::CreateInstance(delegate); | 97 ash::Shell::CreateInstance(delegate); |
98 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); | 98 ash::Shell::GetInstance()->set_browser_context(browser_context_.get()); |
99 | 99 |
100 window_watcher_.reset(new ash::shell::WindowWatcher); | 100 window_watcher_.reset(new ash::shell::WindowWatcher); |
101 delegate->SetWatcher(window_watcher_.get()); | 101 delegate->SetWatcher(window_watcher_.get()); |
102 | 102 |
103 ash::shell::InitWindowTypeLauncher(); | 103 ash::shell::InitWindowTypeLauncher(); |
104 | 104 |
105 Shell::GetInstance()->desktop_background_controller()->SetDefaultWallpaper(0); | 105 DesktopBackgroundController* controller = |
| 106 Shell::GetInstance()->desktop_background_controller(); |
| 107 if (controller->GetAppropriateResolution() == WALLPAPER_RESOLUTION_LARGE) |
| 108 controller->SetDefaultWallpaper(kDefaultLargeWallpaper); |
| 109 else |
| 110 controller->SetDefaultWallpaper(kDefaultSmallWallpaper); |
106 | 111 |
107 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 112 ash::Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
108 } | 113 } |
109 | 114 |
110 void ShellBrowserMainParts::PostMainMessageLoopRun() { | 115 void ShellBrowserMainParts::PostMainMessageLoopRun() { |
111 browser_context_.reset(); | 116 browser_context_.reset(); |
112 | 117 |
113 window_watcher_.reset(); | 118 window_watcher_.reset(); |
114 ash::Shell::DeleteInstance(); | 119 ash::Shell::DeleteInstance(); |
115 aura::Env::DeleteInstance(); | 120 aura::Env::DeleteInstance(); |
116 } | 121 } |
117 | 122 |
118 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 123 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
119 MessageLoopForUI::current()->Run(); | 124 MessageLoopForUI::current()->Run(); |
120 return true; | 125 return true; |
121 } | 126 } |
122 | 127 |
123 } // namespace shell | 128 } // namespace shell |
124 } // namespace ash | 129 } // namespace ash |
OLD | NEW |