OLD | NEW |
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 ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ | 5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ |
6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ | 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ |
7 | 7 |
8 #include "athena/athena_export.h" | 8 #include "athena/athena_export.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 | 10 |
11 typedef unsigned int SkColor; | 11 typedef unsigned int SkColor; |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class ImageSkia; | 14 class ImageSkia; |
15 } | 15 } |
16 | 16 |
17 namespace views { | 17 namespace views { |
18 class View; | 18 class View; |
19 } | 19 } |
20 | 20 |
21 namespace athena { | 21 namespace athena { |
22 | 22 |
23 // The view model for the representation of the activity. | 23 // The view model for the representation of the activity. |
24 class ATHENA_EXPORT ActivityViewModel { | 24 class ATHENA_EXPORT ActivityViewModel { |
25 public: | 25 public: |
26 virtual ~ActivityViewModel() {} | 26 virtual ~ActivityViewModel() {} |
27 | 27 |
28 // Called after the view model is attached to the widget/window tree. | 28 // Called after the view model is attached to the widget/window tree and |
| 29 // before it gets registered to the ActivityManager and the ResourceManager. |
| 30 // At this time the Activity can also be moved to a different place in the |
| 31 // Activity history. |
29 virtual void Init() = 0; | 32 virtual void Init() = 0; |
30 | 33 |
31 // Returns a color most representative of this activity. | 34 // Returns a color most representative of this activity. |
32 virtual SkColor GetRepresentativeColor() const = 0; | 35 virtual SkColor GetRepresentativeColor() const = 0; |
33 | 36 |
34 // Returns a title for the activity. | 37 // Returns a title for the activity. |
35 virtual base::string16 GetTitle() const = 0; | 38 virtual base::string16 GetTitle() const = 0; |
36 | 39 |
37 // True if the activity wants to use Widget's frame, or false if the activity | 40 // True if the activity wants to use Widget's frame, or false if the activity |
38 // draws its own frame. | 41 // draws its own frame. |
(...skipping 13 matching lines...) Expand all Loading... |
52 // overview mode. The returned image can have no size if either a view exists | 55 // overview mode. The returned image can have no size if either a view exists |
53 // or the activity has not yet been loaded. In that case | 56 // or the activity has not yet been loaded. In that case |
54 // GetRepresentativeColor() should be used to clear the preview area. | 57 // GetRepresentativeColor() should be used to clear the preview area. |
55 // Note: We intentionally do not use a layer / view for this. | 58 // Note: We intentionally do not use a layer / view for this. |
56 virtual gfx::ImageSkia GetOverviewModeImage() = 0; | 59 virtual gfx::ImageSkia GetOverviewModeImage() = 0; |
57 }; | 60 }; |
58 | 61 |
59 } // namespace athena | 62 } // namespace athena |
60 | 63 |
61 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ | 64 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ |
OLD | NEW |