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/memory/scoped_ptr.h" | |
9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "ui/gfx/image/image.h" | |
oshima
2014/09/22 16:10:27
forward decl should be enough
Mr4D (OOO till 08-26)
2014/09/23 19:07:33
Done.
| |
10 | 12 |
11 typedef unsigned int SkColor; | 13 typedef unsigned int SkColor; |
12 | 14 |
13 namespace gfx { | |
14 class ImageSkia; | |
15 } | |
16 | |
17 namespace views { | 15 namespace views { |
18 class View; | 16 class View; |
19 class Widget; | 17 class Widget; |
20 } | 18 } |
21 | 19 |
22 namespace athena { | 20 namespace athena { |
23 | 21 |
24 // The view model for the representation of the activity. | 22 // The view model for the representation of the activity. |
25 class ATHENA_EXPORT ActivityViewModel { | 23 class ATHENA_EXPORT ActivityViewModel { |
26 public: | 24 public: |
(...skipping 24 matching lines...) Expand all Loading... | |
51 virtual views::View* GetContentsView() = 0; | 49 virtual views::View* GetContentsView() = 0; |
52 | 50 |
53 // Creates a custom widget for the activity. Returns NULL to use default | 51 // Creates a custom widget for the activity. Returns NULL to use default |
54 // implementation. | 52 // implementation. |
55 virtual views::Widget* CreateWidget() = 0; | 53 virtual views::Widget* CreateWidget() = 0; |
56 | 54 |
57 // Returns an image which can be used to represent the activity in e.g. the | 55 // Returns an image which can be used to represent the activity in e.g. the |
58 // overview mode. The returned image can have no size if either a view exists | 56 // overview mode. The returned image can have no size if either a view exists |
59 // or the activity has not yet been loaded. In that case | 57 // or the activity has not yet been loaded. In that case |
60 // GetRepresentativeColor() should be used to clear the preview area. | 58 // GetRepresentativeColor() should be used to clear the preview area. |
59 // The ownership gets passed to the caller. | |
61 // Note: We intentionally do not use a layer / view for this. | 60 // Note: We intentionally do not use a layer / view for this. |
62 virtual gfx::ImageSkia GetOverviewModeImage() = 0; | 61 virtual scoped_ptr<gfx::Image> GetOverviewModeImage() = 0; |
oshima
2014/09/22 16:10:28
Is there particular reason why this needs to be sc
sadrul
2014/09/22 16:13:32
Why this change?
Mr4D (OOO till 08-26)
2014/09/23 19:07:33
Hmm. I was under the misconception that Image was
Mr4D (OOO till 08-26)
2014/09/23 19:07:33
I have found the PNG decoding to be done with gfx:
oshima
2014/09/24 00:40:00
gfx::Image stores images in ImageStorage, which is
| |
63 | 62 |
64 // Prepares the contents view for overview. | 63 // Prepares the contents view for overview. |
65 virtual void PrepareContentsForOverview() = 0; | 64 virtual void PrepareContentsForOverview() = 0; |
66 | 65 |
67 // Undoes any changes done by PrepareContentsForOverview(). | 66 // Undoes any changes done by PrepareContentsForOverview(). |
68 virtual void ResetContentsView() = 0; | 67 virtual void ResetContentsView() = 0; |
69 }; | 68 }; |
70 | 69 |
71 } // namespace athena | 70 } // namespace athena |
72 | 71 |
73 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ | 72 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_ |
OLD | NEW |