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