OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/desktop_background/wallpaper_resizer.h" | 5 #include "ash/desktop_background/wallpaper_resizer.h" |
6 | 6 |
7 #include "ash/desktop_background/wallpaper_resizer_observer.h" | 7 #include "ash/desktop_background/wallpaper_resizer_observer.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
11 #include "base/threading/worker_pool.h" | 11 #include "base/threading/worker_pool.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "third_party/skia/include/core/SkImage.h" | 13 #include "third_party/skia/include/core/SkImage.h" |
14 #include "ui/base/resource/resource_bundle.h" | |
15 #include "ui/gfx/image/image_skia_rep.h" | 14 #include "ui/gfx/image/image_skia_rep.h" |
16 #include "ui/gfx/skia_util.h" | 15 #include "ui/gfx/skia_util.h" |
17 | 16 |
18 using content::BrowserThread; | 17 using content::BrowserThread; |
19 | 18 |
20 namespace ash { | 19 namespace ash { |
21 namespace { | 20 namespace { |
22 | 21 |
23 // For our scaling ratios we need to round positive numbers. | 22 // For our scaling ratios we need to round positive numbers. |
24 int RoundPositive(double x) { | 23 int RoundPositive(double x) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 136 } |
138 | 137 |
139 void WallpaperResizer::OnResizeFinished(SkBitmap* resized_bitmap) { | 138 void WallpaperResizer::OnResizeFinished(SkBitmap* resized_bitmap) { |
140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
141 image_ = gfx::ImageSkia::CreateFrom1xBitmap(*resized_bitmap); | 140 image_ = gfx::ImageSkia::CreateFrom1xBitmap(*resized_bitmap); |
142 FOR_EACH_OBSERVER(WallpaperResizerObserver, observers_, | 141 FOR_EACH_OBSERVER(WallpaperResizerObserver, observers_, |
143 OnWallpaperResized()); | 142 OnWallpaperResized()); |
144 } | 143 } |
145 | 144 |
146 } // namespace ash | 145 } // namespace ash |
OLD | NEW |