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

Side by Side Diff: chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc

Issue 11369258: Revert 167808 - Get rid of use of CreateStringValue in chromeos/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
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 "chrome/browser/chromeos/login/wallpaper_manager.h" 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
6 6
7 #include "ash/desktop_background/desktop_background_resources.h" 7 #include "ash/desktop_background/desktop_background_resources.h"
8 #include "ash/desktop_background/desktop_background_controller.h" 8 #include "ash/desktop_background/desktop_background_controller.h"
9 #include "ash/desktop_background/desktop_background_controller_observer.h" 9 #include "ash/desktop_background/desktop_background_controller_observer.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 MessageLoop::current()->Run(); 81 MessageLoop::current()->Run();
82 } 82 }
83 83
84 virtual void OnWallpaperDataChanged() OVERRIDE { 84 virtual void OnWallpaperDataChanged() OVERRIDE {
85 MessageLoop::current()->Quit(); 85 MessageLoop::current()->Quit();
86 } 86 }
87 87
88 // Sets |username| wallpaper. 88 // Sets |username| wallpaper.
89 void SetUserWallpaper(const std::string& username) { 89 void SetUserWallpaper(const std::string& username) {
90 ListPrefUpdate users_pref(local_state_, "LoggedInUsers"); 90 ListPrefUpdate users_pref(local_state_, "LoggedInUsers");
91 users_pref->AppendIfNotPresent(new base::StringValue(username)); 91 users_pref->AppendIfNotPresent(base::Value::CreateStringValue(username));
92 WallpaperManager::Get()->SetUserWallpaper(username); 92 WallpaperManager::Get()->SetUserWallpaper(username);
93 } 93 }
94 94
95 protected: 95 protected:
96 // Saves bitmap |resource_id| to disk. 96 // Saves bitmap |resource_id| to disk.
97 void SaveUserWallpaperData(const std::string& username, 97 void SaveUserWallpaperData(const std::string& username,
98 const FilePath& wallpaper_path, 98 const FilePath& wallpaper_path,
99 int resource_id) { 99 int resource_id) {
100 scoped_refptr<base::RefCountedStaticMemory> image_data( 100 scoped_refptr<base::RefCountedStaticMemory> image_data(
101 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( 101 ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 UpdateDisplay("800x600,2000x2000"); 210 UpdateDisplay("800x600,2000x2000");
211 WaitAsyncWallpaperLoad(); 211 WaitAsyncWallpaperLoad();
212 wallpaper = controller_->GetWallpaper(); 212 wallpaper = controller_->GetWallpaper();
213 213
214 // The large resolution custom wallpaper is expected. 214 // The large resolution custom wallpaper is expected.
215 EXPECT_EQ(kExpectedLargeWallpaperWidth, wallpaper.width()); 215 EXPECT_EQ(kExpectedLargeWallpaperWidth, wallpaper.width());
216 EXPECT_EQ(kExpectedLargeWallpaperHeight, wallpaper.height()); 216 EXPECT_EQ(kExpectedLargeWallpaperHeight, wallpaper.height());
217 } 217 }
218 218
219 } // namepace chromeos 219 } // namepace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | chrome/browser/chromeos/media/media_player_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698