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

Side by Side Diff: chrome/browser/chromeos/extensions/wallpaper_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/wallpaper_api.h" 5 #include "chrome/browser/chromeos/extensions/wallpaper_api.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 LAZY_INSTANCE_INITIALIZER; 86 LAZY_INSTANCE_INITIALIZER;
87 87
88 } // namespace 88 } // namespace
89 89
90 WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() { 90 WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() {
91 } 91 }
92 92
93 WallpaperSetWallpaperFunction::~WallpaperSetWallpaperFunction() { 93 WallpaperSetWallpaperFunction::~WallpaperSetWallpaperFunction() {
94 } 94 }
95 95
96 bool WallpaperSetWallpaperFunction::RunImpl() { 96 bool WallpaperSetWallpaperFunction::RunAsync() {
97 params_ = set_wallpaper::Params::Create(*args_); 97 params_ = set_wallpaper::Params::Create(*args_);
98 EXTENSION_FUNCTION_VALIDATE(params_); 98 EXTENSION_FUNCTION_VALIDATE(params_);
99 99
100 // Gets email address and username hash while at UI thread. 100 // Gets email address and username hash while at UI thread.
101 user_id_ = chromeos::UserManager::Get()->GetLoggedInUser()->email(); 101 user_id_ = chromeos::UserManager::Get()->GetLoggedInUser()->email();
102 user_id_hash_ = 102 user_id_hash_ =
103 chromeos::UserManager::Get()->GetLoggedInUser()->username_hash(); 103 chromeos::UserManager::Get()->GetLoggedInUser()->username_hash();
104 104
105 if (params_->details.wallpaper_data) { 105 if (params_->details.wallpaper_data) {
106 StartDecode(*params_->details.wallpaper_data); 106 StartDecode(*params_->details.wallpaper_data);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 bool success, 196 bool success,
197 const std::string& response) { 197 const std::string& response) {
198 if (success) { 198 if (success) {
199 params_->details.wallpaper_data.reset(new std::string(response)); 199 params_->details.wallpaper_data.reset(new std::string(response));
200 StartDecode(*params_->details.wallpaper_data); 200 StartDecode(*params_->details.wallpaper_data);
201 } else { 201 } else {
202 SetError(response); 202 SetError(response);
203 SendResponse(false); 203 SendResponse(false);
204 } 204 }
205 } 205 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/wallpaper_api.h ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698