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

Side by Side Diff: extensions/browser/extension_icon_image.h

Issue 2817293002: Fix randomly disappearing icons in app list recent view. (Closed)
Patch Set: forgot UpdateIcon to match previous logic Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 const Extension* extension, 70 const Extension* extension,
71 const ExtensionIconSet& icon_set, 71 const ExtensionIconSet& icon_set,
72 int resource_size_in_dip, 72 int resource_size_in_dip,
73 const gfx::ImageSkia& default_icon, 73 const gfx::ImageSkia& default_icon,
74 Observer* observer); 74 Observer* observer);
75 ~IconImage() override; 75 ~IconImage() override;
76 76
77 gfx::Image image() const { return image_; } 77 gfx::Image image() const { return image_; }
78 const gfx::ImageSkia& image_skia() const { return image_skia_; } 78 const gfx::ImageSkia& image_skia() const { return image_skia_; }
79 79
80 // Returns true if icon is attached to existing extension.
Devlin 2017/04/15 00:42:54 grammar nit: if *the* icon is attached to *an* exi
khmel 2017/04/15 20:21:28 Done.
81 bool is_valid() const { return extension_.get(); }
82
80 void AddObserver(Observer* observer); 83 void AddObserver(Observer* observer);
81 void RemoveObserver(Observer* observer); 84 void RemoveObserver(Observer* observer);
82 85
83 private: 86 private:
84 class Source; 87 class Source;
85 88
86 // Loads an image representation for the scale factor. 89 // Loads an image representation for the scale factor.
87 // If the representation gets loaded synchronously, it is returned by this 90 // If the representation gets loaded synchronously, it is returned by this
88 // method. 91 // method.
89 // If representation loading is asynchronous, an empty image 92 // If representation loading is asynchronous, an empty image
(...skipping 28 matching lines...) Expand all
118 content::NotificationRegistrar registrar_; 121 content::NotificationRegistrar registrar_;
119 122
120 base::WeakPtrFactory<IconImage> weak_ptr_factory_; 123 base::WeakPtrFactory<IconImage> weak_ptr_factory_;
121 124
122 DISALLOW_COPY_AND_ASSIGN(IconImage); 125 DISALLOW_COPY_AND_ASSIGN(IconImage);
123 }; 126 };
124 127
125 } // namespace extensions 128 } // namespace extensions
126 129
127 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_ 130 #endif // EXTENSIONS_BROWSER_EXTENSION_ICON_IMAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698