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

Unified Diff: athena/activity/public/activity_view_model.h

Issue 358003002: Additions to Activities to allow resource management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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
« no previous file with comments | « athena/activity/public/activity.h ('k') | athena/content/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/activity/public/activity_view_model.h
diff --git a/athena/activity/public/activity_view_model.h b/athena/activity/public/activity_view_model.h
index 8b63d2d1e8ce7dd2cbe6c3e767408f5785b53a9d..9d38ecad048dfcd54fa48ccc706b7613c8e742a1 100644
--- a/athena/activity/public/activity_view_model.h
+++ b/athena/activity/public/activity_view_model.h
@@ -10,17 +10,22 @@
typedef unsigned int SkColor;
+namespace gfx {
+class ImageSkia;
+}
+
namespace views {
class View;
}
namespace athena {
+// The view model for the representation of the activity.
class ATHENA_EXPORT ActivityViewModel {
public:
virtual ~ActivityViewModel() {}
- // Called after the view model is attaced to the widget/window tree.
+ // Called after the view model is attached to the widget/window tree.
virtual void Init() = 0;
// Returns a color most representative of this activity.
@@ -33,8 +38,22 @@ class ATHENA_EXPORT ActivityViewModel {
// draws its own frame.
virtual bool UsesFrame() const = 0;
- // Returns the contents view.
+ // Returns the contents view which might be NULL if the activity is not
+ // loaded. Note that the caller should not hold on to the view since it can
+ // be deleted by the resource manager.
virtual views::View* GetContentsView() = 0;
+
+ // This gets called before the Activity gets (partially) thrown out of memory
+ // to create a preview image of the activity. Note that even if this function
+ // gets called, |GetOverviewModeImage()| could still return an empty image.
+ virtual void CreateOverviewModeImage() = 0;
+
+ // Returns an image which can be used to represent the activity in e.g. the
+ // overview mode. The returned image can have no size if either a view exists
+ // or the activity has not yet been loaded. In that case
+ // GetRepresentativeColor() should be used to clear the preview area.
+ // Note: We intentionally do not use a layer / view for this.
+ virtual gfx::ImageSkia GetOverviewModeImage() = 0;
};
} // namespace athena
« no previous file with comments | « athena/activity/public/activity.h ('k') | athena/content/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698