| 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_H_ | 5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_H_ |
| 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_H_ | 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "athena/athena_export.h" | 10 #include "athena/athena_export.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 class Window; | 13 class Window; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 19 |
| 16 namespace athena { | 20 namespace athena { |
| 17 | 21 |
| 18 class ActivityViewModel; | 22 class ActivityViewModel; |
| 19 | 23 |
| 20 // This class is a high level abstraction of an activity (which could be either | 24 // This class is a high level abstraction of an activity (which could be either |
| 21 // a web page or a V1/V2 app/extension). Through this class the activity can | 25 // a web page or a V1/V2 app/extension). Through this class the activity can |
| 22 // be controlled (e.g. loaded / unloaded). | 26 // be controlled (e.g. loaded / unloaded). |
| 23 // An Activity gets created with state |ACTIVITY_UNLOADED|. | 27 // An Activity gets created with state |ACTIVITY_UNLOADED|. |
| 24 // Requesting |ACTIVITY_VISIBLE| or |ACTIVITY_INVISIBLE| will load it. | 28 // Requesting |ACTIVITY_VISIBLE| or |ACTIVITY_INVISIBLE| will load it. |
| 25 // Once an activity was |ACTIVITY_INVISIBLE| for a while it can be transitioned | 29 // Once an activity was |ACTIVITY_INVISIBLE| for a while it can be transitioned |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 86 |
| 83 // Returns the current media state. | 87 // Returns the current media state. |
| 84 virtual ActivityMediaState GetMediaState() = 0; | 88 virtual ActivityMediaState GetMediaState() = 0; |
| 85 | 89 |
| 86 // Returns the window for the activity. This can be used to determine the | 90 // Returns the window for the activity. This can be used to determine the |
| 87 // stacking order of this activity against others. | 91 // stacking order of this activity against others. |
| 88 // TODO(oshima): Consider returning base::Window window instead, | 92 // TODO(oshima): Consider returning base::Window window instead, |
| 89 // which has Show/ShowInactive and other control methods. | 93 // which has Show/ShowInactive and other control methods. |
| 90 virtual aura::Window* GetWindow() = 0; | 94 virtual aura::Window* GetWindow() = 0; |
| 91 | 95 |
| 96 // Returns the web contents used to draw the content of the activity. |
| 97 // This may return NULL if the web content is not available. |
| 98 virtual content::WebContents* GetWebContents() = 0; |
| 99 |
| 92 protected: | 100 protected: |
| 93 virtual ~Activity() {} | 101 virtual ~Activity() {} |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace athena | 104 } // namespace athena |
| 97 | 105 |
| 98 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_H_ | 106 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_H_ |
| OLD | NEW |