| 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_PUBLIC_WEB_ACTIVITY_H_ | 5 #ifndef ATHENA_CONTENT_PUBLIC_WEB_ACTIVITY_H_ |
| 6 #define ATHENA_CONTENT_PUBLIC_WEB_ACTIVITY_H_ | 6 #define ATHENA_CONTENT_PUBLIC_WEB_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 "base/strings/string16.h" |
| 10 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 11 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 class BrowserContext; | 15 class BrowserContext; |
| 15 class WebContents; | 16 class WebContents; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace views { | 19 namespace views { |
| 19 class WebView; | 20 class WebView; |
| 20 class WidgetDelegate; | 21 class WidgetDelegate; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace athena { | 24 namespace athena { |
| 24 | 25 |
| 25 class AthenaWebView; | 26 class AthenaWebView; |
| 26 | 27 |
| 27 class WebActivity : public Activity, | 28 class WebActivity : public Activity, |
| 28 public ActivityViewModel, | 29 public ActivityViewModel, |
| 29 public content::WebContentsObserver { | 30 public content::WebContentsObserver { |
| 30 public: | 31 public: |
| 31 WebActivity(content::BrowserContext* context, const GURL& gurl); | 32 WebActivity(content::BrowserContext* context, |
| 33 const base::string16& title, |
| 34 const GURL& gurl); |
| 32 WebActivity(AthenaWebView* web_view); | 35 WebActivity(AthenaWebView* web_view); |
| 33 | 36 |
| 34 protected: | 37 protected: |
| 35 virtual ~WebActivity(); | 38 virtual ~WebActivity(); |
| 36 | 39 |
| 37 // Activity: | 40 // Activity: |
| 38 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; | 41 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; |
| 39 virtual void SetCurrentState(ActivityState state) OVERRIDE; | 42 virtual void SetCurrentState(ActivityState state) OVERRIDE; |
| 40 virtual ActivityState GetCurrentState() OVERRIDE; | 43 virtual ActivityState GetCurrentState() OVERRIDE; |
| 41 virtual bool IsVisible() OVERRIDE; | 44 virtual bool IsVisible() OVERRIDE; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 64 void MakeVisible(); | 67 void MakeVisible(); |
| 65 | 68 |
| 66 // Make the content invisible. This call should only be paired with | 69 // Make the content invisible. This call should only be paired with |
| 67 // MakeVisible. | 70 // MakeVisible. |
| 68 void MakeInvisible(); | 71 void MakeInvisible(); |
| 69 | 72 |
| 70 // Reload the content if required, and start observing it. | 73 // Reload the content if required, and start observing it. |
| 71 void ReloadAndObserve(); | 74 void ReloadAndObserve(); |
| 72 | 75 |
| 73 content::BrowserContext* browser_context_; | 76 content::BrowserContext* browser_context_; |
| 77 const base::string16 title_; |
| 74 const GURL url_; | 78 const GURL url_; |
| 75 AthenaWebView* web_view_; | 79 AthenaWebView* web_view_; |
| 76 SkColor title_color_; | 80 SkColor title_color_; |
| 77 | 81 |
| 78 // The current state for this activity. | 82 // The current state for this activity. |
| 79 ActivityState current_state_; | 83 ActivityState current_state_; |
| 80 | 84 |
| 81 // The image which will be used in overview mode. | 85 // The image which will be used in overview mode. |
| 82 gfx::ImageSkia overview_mode_image_; | 86 gfx::ImageSkia overview_mode_image_; |
| 83 | 87 |
| 84 DISALLOW_COPY_AND_ASSIGN(WebActivity); | 88 DISALLOW_COPY_AND_ASSIGN(WebActivity); |
| 85 }; | 89 }; |
| 86 | 90 |
| 87 } // namespace athena | 91 } // namespace athena |
| 88 | 92 |
| 89 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ | 93 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ |
| OLD | NEW |