OLD | NEW |
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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 extension()->name()); | 176 extension()->name()); |
177 } | 177 } |
178 SendResponse(true); | 178 SendResponse(true); |
179 } | 179 } |
180 | 180 |
181 // Inform the native Wallpaper Picker Application that the current wallpaper | 181 // Inform the native Wallpaper Picker Application that the current wallpaper |
182 // has been modified by a third party application. | 182 // has been modified by a third party application. |
183 Profile* profile = Profile::FromBrowserContext(browser_context()); | 183 Profile* profile = Profile::FromBrowserContext(browser_context()); |
184 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); | 184 extensions::EventRouter* event_router = extensions::EventRouter::Get(profile); |
185 scoped_ptr<base::ListValue> event_args(new base::ListValue()); | 185 scoped_ptr<base::ListValue> event_args(new base::ListValue()); |
186 scoped_ptr<extensions::Event> event( | 186 scoped_ptr<extensions::Event> event(new extensions::Event( |
187 new extensions::Event(extensions::api::wallpaper_private:: | 187 extensions::events::UNKNOWN, extensions::api::wallpaper_private:: |
188 OnWallpaperChangedBy3rdParty::kEventName, | 188 OnWallpaperChangedBy3rdParty::kEventName, |
189 event_args.Pass())); | 189 event_args.Pass())); |
190 event_router->DispatchEventToExtension(extension_misc::kWallpaperManagerId, | 190 event_router->DispatchEventToExtension(extension_misc::kWallpaperManagerId, |
191 event.Pass()); | 191 event.Pass()); |
192 } | 192 } |
193 | 193 |
194 void WallpaperSetWallpaperFunction::GenerateThumbnail( | 194 void WallpaperSetWallpaperFunction::GenerateThumbnail( |
195 const base::FilePath& thumbnail_path, scoped_ptr<gfx::ImageSkia> image) { | 195 const base::FilePath& thumbnail_path, scoped_ptr<gfx::ImageSkia> image) { |
196 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( | 196 DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( |
197 sequence_token_)); | 197 sequence_token_)); |
198 if (!base::PathExists(thumbnail_path.DirName())) | 198 if (!base::PathExists(thumbnail_path.DirName())) |
199 base::CreateDirectory(thumbnail_path.DirName()); | 199 base::CreateDirectory(thumbnail_path.DirName()); |
(...skipping 23 matching lines...) Expand all Loading... |
223 const std::string& response) { | 223 const std::string& response) { |
224 if (success) { | 224 if (success) { |
225 params_->details.data.reset( | 225 params_->details.data.reset( |
226 new std::vector<char>(response.begin(), response.end())); | 226 new std::vector<char>(response.begin(), response.end())); |
227 StartDecode(*params_->details.data); | 227 StartDecode(*params_->details.data); |
228 } else { | 228 } else { |
229 SetError(response); | 229 SetError(response); |
230 SendResponse(false); | 230 SendResponse(false); |
231 } | 231 } |
232 } | 232 } |
OLD | NEW |