Chromium Code Reviews| 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 5e6614c8cbabb61bd742c219306459f35b95a97e..fe51e278279551f6fdf1df3e46f8ba78df5fb4b1 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. |
| @@ -29,8 +34,22 @@ class ATHENA_EXPORT ActivityViewModel { |
| // Returns a title for the activity. |
| virtual base::string16 GetTitle() = 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; |
|
oshima
2014/07/11 18:02:59
Since the actual behavior is undefined, how about
Mr4D (OOO till 08-26)
2014/07/11 22:38:08
In the question of "Prepare" vs. "create" I would
|
| + |
| + // 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 |