Some additional network settings cleanup
[chromium-blink-merge.git] / athena / activity / public / activity_view_model.h
blob2621585b3bbf858e1abe0c592dbe6c05e403aaac
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
3 // found in the LICENSE file.
5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_
6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_
8 #include "athena/athena_export.h"
9 #include "base/strings/string16.h"
11 typedef unsigned int SkColor;
13 namespace gfx {
14 class ImageSkia;
17 namespace views {
18 class View;
19 class Widget;
22 namespace athena {
24 // The view model for the representation of the activity.
25 class ATHENA_EXPORT ActivityViewModel {
26 public:
27 virtual ~ActivityViewModel() {}
29 // Called after the view model is attached to the widget/window tree and
30 // before it gets registered to the ActivityManager and the ResourceManager.
31 // At this time the Activity can also be moved to a different place in the
32 // Activity history.
33 virtual void Init() = 0;
35 // Returns a color most representative of this activity.
36 virtual SkColor GetRepresentativeColor() const = 0;
38 // Returns a title for the activity.
39 virtual base::string16 GetTitle() const = 0;
41 // Returns an icon for the activity.
42 virtual gfx::ImageSkia GetIcon() const = 0;
44 // True if the activity wants to use Widget's frame, or false if the activity
45 // draws its own frame.
46 virtual bool UsesFrame() const = 0;
48 // Returns the contents view which might be NULL if the activity is not
49 // loaded. Note that the caller should not hold on to the view since it can
50 // be deleted by the resource manager.
51 virtual views::View* GetContentsView() = 0;
53 // Creates a custom widget for the activity. Returns NULL to use default
54 // implementation.
55 virtual views::Widget* CreateWidget() = 0;
57 // This gets called before the Activity gets (partially) thrown out of memory
58 // to create a preview image of the activity. Note that even if this function
59 // gets called, |GetOverviewModeImage()| could still return an empty image.
60 virtual void CreateOverviewModeImage() = 0;
62 // Returns an image which can be used to represent the activity in e.g. the
63 // overview mode. The returned image can have no size if either a view exists
64 // or the activity has not yet been loaded. In that case
65 // GetRepresentativeColor() should be used to clear the preview area.
66 // Note: We intentionally do not use a layer / view for this.
67 virtual gfx::ImageSkia GetOverviewModeImage() = 0;
69 // Prepares the contents view for overview.
70 virtual void PrepareContentsForOverview() = 0;
72 // Undoes any changes done by PrepareContentsForOverview().
73 virtual void ResetContentsView() = 0;
76 } // namespace athena
78 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_