OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOADER
_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOADER
_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOADER
_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOADER
_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Wallpaper directory (to be created). | 86 // Wallpaper directory (to be created). |
87 const base::FilePath wallpaper_dir_; | 87 const base::FilePath wallpaper_dir_; |
88 | 88 |
89 // Full path to local file to save downloaded wallpaper. | 89 // Full path to local file to save downloaded wallpaper. |
90 const base::FilePath wallpaper_downloaded_file_; | 90 const base::FilePath wallpaper_downloaded_file_; |
91 | 91 |
92 // Full path to temporary file to fetch downloaded wallpper. | 92 // Full path to temporary file to fetch downloaded wallpper. |
93 const base::FilePath wallpaper_temporary_file_; | 93 const base::FilePath wallpaper_temporary_file_; |
94 | 94 |
95 // Pending retry. | 95 // Pending retry. |
96 base::OneShotTimer<CustomizationWallpaperDownloader> request_scheduled_; | 96 base::OneShotTimer request_scheduled_; |
97 | 97 |
98 // Number of download retries (first attempt is not counted as retry). | 98 // Number of download retries (first attempt is not counted as retry). |
99 size_t retries_; | 99 size_t retries_; |
100 | 100 |
101 // Sleep between retry requests (increasing, see Retry() method for details). | 101 // Sleep between retry requests (increasing, see Retry() method for details). |
102 // Non-constant value for tests. | 102 // Non-constant value for tests. |
103 base::TimeDelta retry_delay_; | 103 base::TimeDelta retry_delay_; |
104 | 104 |
105 // Retry delay of the last attempt. For testing only. | 105 // Retry delay of the last attempt. For testing only. |
106 base::TimeDelta retry_current_delay_; | 106 base::TimeDelta retry_current_delay_; |
107 | 107 |
108 // Callback supplied by caller. | 108 // Callback supplied by caller. |
109 base::Callback<void(bool success, const GURL&)> on_wallpaper_fetch_completed_; | 109 base::Callback<void(bool success, const GURL&)> on_wallpaper_fetch_completed_; |
110 | 110 |
111 base::WeakPtrFactory<CustomizationWallpaperDownloader> weak_factory_; | 111 base::WeakPtrFactory<CustomizationWallpaperDownloader> weak_factory_; |
112 | 112 |
113 DISALLOW_COPY_AND_ASSIGN(CustomizationWallpaperDownloader); | 113 DISALLOW_COPY_AND_ASSIGN(CustomizationWallpaperDownloader); |
114 }; | 114 }; |
115 | 115 |
116 } // namespace chromeos | 116 } // namespace chromeos |
117 | 117 |
118 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOA
DER_H_ | 118 #endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_DOWNLOA
DER_H_ |
OLD | NEW |