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 virtual ~WebActivity(); | 36 virtual ~WebActivity(); |
34 | 37 |
35 protected: | 38 protected: |
36 // Activity: | 39 // Activity: |
37 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; | 40 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; |
38 virtual void SetCurrentState(ActivityState state) OVERRIDE; | 41 virtual void SetCurrentState(ActivityState state) OVERRIDE; |
39 virtual ActivityState GetCurrentState() OVERRIDE; | 42 virtual ActivityState GetCurrentState() OVERRIDE; |
40 virtual bool IsVisible() OVERRIDE; | 43 virtual bool IsVisible() OVERRIDE; |
41 virtual ActivityMediaState GetMediaState() OVERRIDE; | 44 virtual ActivityMediaState GetMediaState() OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
52 | 55 |
53 // content::WebContentsObserver: | 56 // content::WebContentsObserver: |
54 virtual void TitleWasSet(content::NavigationEntry* entry, | 57 virtual void TitleWasSet(content::NavigationEntry* entry, |
55 bool explicit_set) OVERRIDE; | 58 bool explicit_set) OVERRIDE; |
56 virtual void DidUpdateFaviconURL( | 59 virtual void DidUpdateFaviconURL( |
57 const std::vector<content::FaviconURL>& candidates) OVERRIDE; | 60 const std::vector<content::FaviconURL>& candidates) OVERRIDE; |
58 virtual void DidChangeThemeColor(SkColor theme_color) OVERRIDE; | 61 virtual void DidChangeThemeColor(SkColor theme_color) OVERRIDE; |
59 | 62 |
60 private: | 63 private: |
61 content::BrowserContext* browser_context_; | 64 content::BrowserContext* browser_context_; |
| 65 const base::string16 title_; |
62 const GURL url_; | 66 const GURL url_; |
63 AthenaWebView* web_view_; | 67 AthenaWebView* web_view_; |
64 SkColor title_color_; | 68 SkColor title_color_; |
65 | 69 |
66 // The current state for this activity. | 70 // The current state for this activity. |
67 ActivityState current_state_; | 71 ActivityState current_state_; |
68 | 72 |
69 // The image which will be used in overview mode. | 73 // The image which will be used in overview mode. |
70 gfx::ImageSkia overview_mode_image_; | 74 gfx::ImageSkia overview_mode_image_; |
71 | 75 |
72 DISALLOW_COPY_AND_ASSIGN(WebActivity); | 76 DISALLOW_COPY_AND_ASSIGN(WebActivity); |
73 }; | 77 }; |
74 | 78 |
75 } // namespace athena | 79 } // namespace athena |
76 | 80 |
77 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ | 81 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ |
OLD | NEW |