| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // that new icon is available and corresponding item should invoke | 83 // that new icon is available and corresponding item should invoke |
| 84 // LoadImageForScaleFactor again. | 84 // LoadImageForScaleFactor again. |
| 85 void LoadForScaleFactor(ui::ScaleFactor scale_factor); | 85 void LoadForScaleFactor(ui::ScaleFactor scale_factor); |
| 86 | 86 |
| 87 void MaybeRequestIcon(ui::ScaleFactor scale_factor); | 87 void MaybeRequestIcon(ui::ScaleFactor scale_factor); |
| 88 static std::unique_ptr<ArcAppIcon::ReadResult> ReadOnFileThread( | 88 static std::unique_ptr<ArcAppIcon::ReadResult> ReadOnFileThread( |
| 89 ui::ScaleFactor scale_factor, | 89 ui::ScaleFactor scale_factor, |
| 90 const base::FilePath& path, | 90 const base::FilePath& path, |
| 91 const base::FilePath& default_app_path); | 91 const base::FilePath& default_app_path); |
| 92 void OnIconRead(std::unique_ptr<ArcAppIcon::ReadResult> read_result); | 92 void OnIconRead(std::unique_ptr<ArcAppIcon::ReadResult> read_result); |
| 93 void Update(const gfx::ImageSkia* image); | 93 void Update(ui::ScaleFactor scale_factor, const SkBitmap& bitmap); |
| 94 void DiscardDecodeRequest(DecodeRequest* request); | 94 void DiscardDecodeRequest(DecodeRequest* request); |
| 95 | 95 |
| 96 content::BrowserContext* context_; | 96 content::BrowserContext* context_; |
| 97 std::string app_id_; | 97 std::string app_id_; |
| 98 const int resource_size_in_dip_; | 98 const int resource_size_in_dip_; |
| 99 Observer* observer_; | 99 Observer* observer_; |
| 100 | 100 |
| 101 Source* source_ = nullptr; // Owned by ImageSkia storage. | 101 Source* source_ = nullptr; // Owned by ImageSkia storage. |
| 102 gfx::ImageSkia image_skia_; | 102 gfx::ImageSkia image_skia_; |
| 103 | 103 |
| 104 // Contains pending image decode requests. | 104 // Contains pending image decode requests. |
| 105 std::vector<std::unique_ptr<DecodeRequest>> decode_requests_; | 105 std::vector<std::unique_ptr<DecodeRequest>> decode_requests_; |
| 106 | 106 |
| 107 base::WeakPtrFactory<ArcAppIcon> weak_ptr_factory_; | 107 base::WeakPtrFactory<ArcAppIcon> weak_ptr_factory_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(ArcAppIcon); | 109 DISALLOW_COPY_AND_ASSIGN(ArcAppIcon); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 112 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| OLD | NEW |