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_CONTENT_APP_ACTIVITY_REGISTRY_H_ | 5 #ifndef ATHENA_CONTENT_APP_ACTIVITY_REGISTRY_H_ |
6 #define ATHENA_CONTENT_APP_ACTIVITY_REGISTRY_H_ | 6 #define ATHENA_CONTENT_APP_ACTIVITY_REGISTRY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "athena/activity/public/activity_view_model.h" | 10 #include "athena/activity/public/activity_view_model.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // When the |AppActivityProxy| gets destroyed it should call this function | 68 // When the |AppActivityProxy| gets destroyed it should call this function |
69 // to disconnect from this object. This call might destroy |this|. | 69 // to disconnect from this object. This call might destroy |this|. |
70 void ProxyDestroyed(AppActivityProxy* proxy); | 70 void ProxyDestroyed(AppActivityProxy* proxy); |
71 | 71 |
72 // When called by the |AppActivityProxy| to restart the application, it can | 72 // When called by the |AppActivityProxy| to restart the application, it can |
73 // cause the application to restart. When that happens the proxy will get | 73 // cause the application to restart. When that happens the proxy will get |
74 // destroyed. After this call |this| might be destroyed. | 74 // destroyed. After this call |this| might be destroyed. |
75 void RestartApplication(AppActivityProxy* proxy); | 75 void RestartApplication(AppActivityProxy* proxy); |
76 | 76 |
77 private: | 77 private: |
78 // Called if an unload of an application should take place asynchronously to | |
79 // avoid object destruction within an observer handler. | |
80 void DelayedUnload(); | |
81 | |
82 // Gets most recently used AppAcitivty that belongs to the same application. | 78 // Gets most recently used AppAcitivty that belongs to the same application. |
83 AppActivity* GetMruActivity(); | 79 AppActivity* GetMruActivity(); |
84 | 80 |
85 // A list of all activities associated with this application. | 81 // A list of all activities associated with this application. |
86 std::vector<AppActivity*> activity_list_; | 82 std::vector<AppActivity*> activity_list_; |
87 | 83 |
88 // The application id for this proxy. | 84 // The application id for this proxy. |
89 std::string app_id_; | 85 std::string app_id_; |
90 | 86 |
91 // The browser context of the user. | 87 // The browser context of the user. |
92 content::BrowserContext* browser_context_; | 88 content::BrowserContext* browser_context_; |
93 | 89 |
94 // When the activity is unloaded this is the AppActivityProxy. The object is | 90 // When the activity is unloaded this is the AppActivityProxy. The object is |
95 // owned the the ActivityManager. | 91 // owned the the ActivityManager. |
96 AppActivityProxy* unloaded_activity_proxy_; | 92 AppActivityProxy* unloaded_activity_proxy_; |
97 | 93 |
98 // The presentation values. | 94 // The presentation values. |
99 SkColor color_; | 95 SkColor color_; |
100 base::string16 title_; | 96 base::string16 title_; |
101 gfx::ImageSkia image_; | 97 gfx::ImageSkia image_; |
102 | 98 |
103 DISALLOW_COPY_AND_ASSIGN(AppActivityRegistry); | 99 DISALLOW_COPY_AND_ASSIGN(AppActivityRegistry); |
104 }; | 100 }; |
105 | 101 |
106 } // namespace athena | 102 } // namespace athena |
107 | 103 |
108 #endif // ATHENA_CONTENT_APP_ACTIVITY_REGISTRY_H_ | 104 #endif // ATHENA_CONTENT_APP_ACTIVITY_REGISTRY_H_ |
OLD | NEW |