Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_icon.h

Issue 2864243006: [Merge M59] arc: Prevent overwriting of the Chrome Play Store icon. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/arc/arc_app_icon.h
diff --git a/chrome/browser/ui/app_list/arc/arc_app_icon.h b/chrome/browser/ui/app_list/arc/arc_app_icon.h
index 2d4c618eab919d1eff881608f2ef27f5a9818328..473257cdbf5b3dfe6264026445e2bf2ff4957423 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_icon.h
+++ b/chrome/browser/ui/app_list/arc/arc_app_icon.h
@@ -45,26 +45,8 @@ class ArcAppIcon {
~ArcAppIcon();
const std::string& app_id() const { return app_id_; }
- gfx::Image image() const { return image_; }
const gfx::ImageSkia& image_skia() const { return image_skia_; }
- // Icon loading is performed in several steps. It is initiated by
- // LoadImageForScaleFactor request that specifies a required scale factor.
- // ArcAppListPrefs is used to resolve a path to resource. Content of file is
- // asynchronously read in context of browser file thread. On successful read,
- // an icon data is decoded to an image in the special utility process.
- // DecodeRequest is used to interact with the utility process, and each
- // active request is stored at |decode_requests_| vector. When decoding is
- // complete, results are returned in context of UI thread, and corresponding
- // request is removed from |decode_requests_|. In case of some requests are
- // not completed by the time of deleting this icon, they are automatically
- // canceled.
- // In case of the icon file is not available this requests ArcAppListPrefs to
- // install required resource from ARC side. ArcAppListPrefs notifies UI items
- // that new icon is available and corresponding item should invoke
- // LoadImageForScaleFactor again.
- void LoadForScaleFactor(ui::ScaleFactor scale_factor);
-
// Disables async safe decoding requests when unit tests are executed. This is
// done to avoid two problems. Problems come because icons are decoded at a
// separate process created by ImageDecoder. ImageDecoder has 5 seconds delay
@@ -78,10 +60,30 @@ class ArcAppIcon {
static void DisableSafeDecodingForTesting();
private:
+ friend class ArcAppIconLoader;
+ friend class ArcAppModelBuilder;
+
class Source;
class DecodeRequest;
struct ReadResult;
+ // Icon loading is performed in several steps. It is initiated by
+ // LoadImageForScaleFactor request that specifies a required scale factor.
+ // ArcAppListPrefs is used to resolve a path to resource. Content of file is
+ // asynchronously read in context of browser file thread. On successful read,
+ // an icon data is decoded to an image in the special utility process.
+ // DecodeRequest is used to interact with the utility process, and each
+ // active request is stored at |decode_requests_| vector. When decoding is
+ // complete, results are returned in context of UI thread, and corresponding
+ // request is removed from |decode_requests_|. In case of some requests are
+ // not completed by the time of deleting this icon, they are automatically
+ // canceled.
+ // In case of the icon file is not available this requests ArcAppListPrefs to
+ // install required resource from ARC side. ArcAppListPrefs notifies UI items
+ // that new icon is available and corresponding item should invoke
+ // LoadImageForScaleFactor again.
+ void LoadForScaleFactor(ui::ScaleFactor scale_factor);
+
void MaybeRequestIcon(ui::ScaleFactor scale_factor);
static std::unique_ptr<ArcAppIcon::ReadResult> ReadOnFileThread(
ui::ScaleFactor scale_factor,
@@ -99,10 +101,6 @@ class ArcAppIcon {
Source* source_ = nullptr; // Owned by ImageSkia storage.
gfx::ImageSkia image_skia_;
- // The image wrapper around |image_skia_|.
- // Note: this is reset each time a new representation is loaded.
- gfx::Image image_;
-
// Contains pending image decode requests.
std::vector<std::unique_ptr<DecodeRequest>> decode_requests_;

Powered by Google App Engine
This is Rietveld 408576698