| 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 "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class BrowserContext; | 13 class BrowserContext; |
| 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 AthenaWebView; |
| 24 |
| 23 class WebActivity : public Activity, | 25 class WebActivity : public Activity, |
| 24 public ActivityViewModel, | 26 public ActivityViewModel, |
| 25 public content::WebContentsObserver { | 27 public content::WebContentsObserver { |
| 26 public: | 28 public: |
| 27 WebActivity(content::BrowserContext* context, const GURL& gurl); | 29 WebActivity(content::BrowserContext* context, const GURL& gurl); |
| 28 virtual ~WebActivity(); | 30 virtual ~WebActivity(); |
| 29 | 31 |
| 30 protected: | 32 protected: |
| 31 // Activity: | 33 // Activity: |
| 32 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; | 34 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; |
| 35 virtual void SetCurrentState(ActivityStateTransition state) OVERRIDE; |
| 36 virtual ActivityState GetCurrentState() OVERRIDE; |
| 33 | 37 |
| 34 // ActivityViewModel: | 38 // ActivityViewModel: |
| 35 virtual void Init() OVERRIDE; | 39 virtual void Init() OVERRIDE; |
| 36 virtual SkColor GetRepresentativeColor() OVERRIDE; | 40 virtual SkColor GetRepresentativeColor() OVERRIDE; |
| 37 virtual base::string16 GetTitle() OVERRIDE; | 41 virtual base::string16 GetTitle() OVERRIDE; |
| 38 virtual views::View* GetContentsView() OVERRIDE; | 42 virtual views::View* GetContentsView() OVERRIDE; |
| 43 virtual void CreateOverviewModeImage() OVERRIDE; |
| 44 virtual const gfx::ImageSkia GetOverviewModeImage() OVERRIDE; |
| 39 | 45 |
| 40 // content::WebContentsObserver: | 46 // content::WebContentsObserver: |
| 41 virtual void TitleWasSet(content::NavigationEntry* entry, | 47 virtual void TitleWasSet(content::NavigationEntry* entry, |
| 42 bool explicit_set) OVERRIDE; | 48 bool explicit_set) OVERRIDE; |
| 43 virtual void DidUpdateFaviconURL( | 49 virtual void DidUpdateFaviconURL( |
| 44 const std::vector<content::FaviconURL>& candidates) OVERRIDE; | 50 const std::vector<content::FaviconURL>& candidates) OVERRIDE; |
| 45 | 51 |
| 46 private: | 52 private: |
| 47 content::BrowserContext* browser_context_; | 53 content::BrowserContext* browser_context_; |
| 48 content::WebContents* web_contents_; | |
| 49 const GURL url_; | 54 const GURL url_; |
| 50 views::WebView* web_view_; | 55 AthenaWebView* web_view_; |
| 56 |
| 57 // The last requested state for this activity. |
| 58 ActivityStateTransition last_requested_state_; |
| 59 |
| 60 // The image which will be uded in overview mode. |
| 61 gfx::ImageSkia overview_mode_image_; |
| 51 | 62 |
| 52 DISALLOW_COPY_AND_ASSIGN(WebActivity); | 63 DISALLOW_COPY_AND_ASSIGN(WebActivity); |
| 53 }; | 64 }; |
| 54 | 65 |
| 55 } // namespace athena | 66 } // namespace athena |
| 56 | 67 |
| 57 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ | 68 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ |
| OLD | NEW |