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

Unified Diff: ash/shell.cc

Issue 9764012: Restore to user selected wallpaper after browser crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create a dummy class to fix test fail. Created 8 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 64803e8917d50bf4819b8177747c482b8a77d846..967184f9bf2d2b93f6cd36f3ea7c8b3898e78746 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -229,6 +229,22 @@ void CreateSpecialContainers(aura::RootWindow* root_window) {
lock_screen_related_containers);
}
+// This dummy class is used for shell unit tests. We dont have chrome delegate
+// in these tests.
+class DummyUserWallpaperDelegate: public UserWallpaperDelegate {
+ public:
+ DummyUserWallpaperDelegate() {}
+
+ virtual ~DummyUserWallpaperDelegate() {}
+
+ const int GetUserWallpaperIndex() {
+ return 0;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DummyUserWallpaperDelegate);
+};
+
class DummySystemTrayDelegate : public SystemTrayDelegate {
public:
DummySystemTrayDelegate()
@@ -638,6 +654,10 @@ void Shell::Init() {
// This controller needs to be set before SetupManagedWindowMode.
desktop_background_controller_.reset(new DesktopBackgroundController);
+ if (delegate_.get())
+ user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate());
+ if (!user_wallpaper_delegate_.get())
+ user_wallpaper_delegate_.reset(new DummyUserWallpaperDelegate());
InitLayoutManagers();
@@ -798,8 +818,11 @@ void Shell::InitLayoutManagers() {
new internal::WorkspaceController(default_container));
workspace_controller_->workspace_manager()->set_shelf(shelf_layout_manager);
- // Create the desktop background image.
- desktop_background_controller_->SetDefaultDesktopBackgroundImage();
+ // Create desktop background widget.
+ // TODO(bshe): We should be able to use OnDesktopBackgroundChanged function
+ // here after issue 117244 got fixed.
+ desktop_background_controller_->SetDesktopBackgroundImageMode(
+ GetWallpaper(user_wallpaper_delegate_->GetUserWallpaperIndex()));
}
void Shell::DisableWorkspaceGridLayout() {
« no previous file with comments | « ash/shell.h ('k') | ash/shell/shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698