Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: ash/shell/content_client/shell_browser_main_parts.cc

Issue 11415015: Remove use of index in wallpaper picker code and some refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix browser tests Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell.cc ('k') | ash/shell_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/shell_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698