| 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_H_ | 5 #ifndef ATHENA_CONTENT_APP_ACTIVITY_H_ |
| 6 #define ATHENA_CONTENT_APP_ACTIVITY_H_ | 6 #define ATHENA_CONTENT_APP_ACTIVITY_H_ |
| 7 | 7 |
| 8 #include "athena/activity/public/activity.h" | 8 #include "athena/activity/public/activity.h" |
| 9 #include "athena/activity/public/activity_view_model.h" | 9 #include "athena/activity/public/activity_view_model.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 12 | 12 |
| 13 namespace contents { | 13 namespace contents { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 class WebView; | 18 class WebView; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace athena { | 21 namespace athena { |
| 22 | 22 |
| 23 class AppActivityRegistry; | 23 class AppActivityRegistry; |
| 24 | 24 |
| 25 // The activity object for a hosted V2 application. | 25 // The activity object for a hosted V2 application. |
| 26 class AppActivity : public Activity, | 26 class AppActivity : public Activity, |
| 27 public ActivityViewModel, | 27 public ActivityViewModel, |
| 28 public content::WebContentsObserver { | 28 public content::WebContentsObserver { |
| 29 public: | 29 public: |
| 30 AppActivity(); | 30 explicit AppActivity(const std::string& app_id); |
| 31 virtual ~AppActivity(); | 31 virtual ~AppActivity(); |
| 32 | 32 |
| 33 // Activity: | 33 // Activity: |
| 34 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; | 34 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; |
| 35 virtual void SetCurrentState(Activity::ActivityState state) OVERRIDE; | 35 virtual void SetCurrentState(Activity::ActivityState state) OVERRIDE; |
| 36 virtual ActivityState GetCurrentState() OVERRIDE; | 36 virtual ActivityState GetCurrentState() OVERRIDE; |
| 37 virtual bool IsVisible() OVERRIDE; | 37 virtual bool IsVisible() OVERRIDE; |
| 38 virtual ActivityMediaState GetMediaState() OVERRIDE; | 38 virtual ActivityMediaState GetMediaState() OVERRIDE; |
| 39 virtual aura::Window* GetWindow() OVERRIDE; | 39 virtual aura::Window* GetWindow() OVERRIDE; |
| 40 | 40 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 57 const GURL& url, | 57 const GURL& url, |
| 58 content::NavigationController::ReloadType reload_type) OVERRIDE; | 58 content::NavigationController::ReloadType reload_type) OVERRIDE; |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual content::WebContents* GetWebContents() = 0; | 61 virtual content::WebContents* GetWebContents() = 0; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Register this activity with its application. | 64 // Register this activity with its application. |
| 65 void RegisterActivity(); | 65 void RegisterActivity(); |
| 66 | 66 |
| 67 const std::string app_id_; |
| 68 |
| 67 views::WebView* web_view_; | 69 views::WebView* web_view_; |
| 68 | 70 |
| 69 // The current state for this activity. | 71 // The current state for this activity. |
| 70 ActivityState current_state_; | 72 ActivityState current_state_; |
| 71 | 73 |
| 72 // The image which will be used in overview mode. | 74 // The image which will be used in overview mode. |
| 73 gfx::ImageSkia overview_mode_image_; | 75 gfx::ImageSkia overview_mode_image_; |
| 74 | 76 |
| 75 // If known the registry which holds all activities for the associated app. | 77 // If known the registry which holds all activities for the associated app. |
| 76 // This object is owned by |AppRegistry| and will be a valid pointer as long | 78 // This object is owned by |AppRegistry| and will be a valid pointer as long |
| 77 // as this object lives. | 79 // as this object lives. |
| 78 AppActivityRegistry* app_activity_registry_; | 80 AppActivityRegistry* app_activity_registry_; |
| 79 | 81 |
| 80 DISALLOW_COPY_AND_ASSIGN(AppActivity); | 82 DISALLOW_COPY_AND_ASSIGN(AppActivity); |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 } // namespace athena | 85 } // namespace athena |
| 84 | 86 |
| 85 #endif // ATHENA_CONTENT_APP_ACTIVITY_H_ | 87 #endif // ATHENA_CONTENT_APP_ACTIVITY_H_ |
| OLD | NEW |