OLD | NEW |
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/ui/webui/options/chromeos/wallpaper_source.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/wallpaper_source.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 "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/synchronization/cancellation_flag.h" | 10 #include "base/synchronization/cancellation_flag.h" |
11 #include "base/threading/worker_pool.h" | 11 #include "base/threading/worker_pool.h" |
12 #include "chrome/browser/chromeos/login/user_manager.h" | 12 #include "chrome/browser/chromeos/login/user_manager.h" |
13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "grit/ui_resources.h" | 15 #include "grit/ui_resources.h" |
16 #include "net/base/mime_util.h" | 16 #include "net/base/mime_util.h" |
17 #include "ui/gfx/codec/png_codec.h" | 17 #include "ui/gfx/codec/png_codec.h" |
18 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
19 #include "ui/gfx/skia_util.h" | 19 #include "ui/gfx/skia_util.h" |
20 | 20 |
21 extern "C" { | 21 extern "C" { |
22 #if defined(USE_SYSTEM_ZLIB) | |
23 #include <zlib.h> | |
24 #else | |
25 #include "third_party/zlib/zlib.h" | 22 #include "third_party/zlib/zlib.h" |
26 #endif | |
27 } | 23 } |
28 | 24 |
29 namespace chromeos { | 25 namespace chromeos { |
30 namespace options { | 26 namespace options { |
31 | 27 |
32 // Operation class that encodes existing in-memory image as PNG. | 28 // Operation class that encodes existing in-memory image as PNG. |
33 // It uses NO-COMPRESSION to save time. | 29 // It uses NO-COMPRESSION to save time. |
34 class WallpaperImageSource::WallpaperEncodingOperation | 30 class WallpaperImageSource::WallpaperEncodingOperation |
35 : public base::RefCountedThreadSafe< | 31 : public base::RefCountedThreadSafe< |
36 WallpaperImageSource::WallpaperEncodingOperation> { | 32 WallpaperImageSource::WallpaperEncodingOperation> { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 174 |
179 void WallpaperImageSource::SendCurrentUserWallpaper(int request_id, | 175 void WallpaperImageSource::SendCurrentUserWallpaper(int request_id, |
180 scoped_refptr<base::RefCountedBytes> data) { | 176 scoped_refptr<base::RefCountedBytes> data) { |
181 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 177 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
182 SendResponse(request_id, data); | 178 SendResponse(request_id, data); |
183 TRACE_EVENT_ASYNC_END0("SCREEN_LOCK", "GetUserWallpaper", request_id); | 179 TRACE_EVENT_ASYNC_END0("SCREEN_LOCK", "GetUserWallpaper", request_id); |
184 } | 180 } |
185 | 181 |
186 } // namespace options | 182 } // namespace options |
187 } // namespace chromeos | 183 } // namespace chromeos |
OLD | NEW |