| 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 class WidgetDelegate; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace athena { | 22 namespace athena { |
| 22 | 23 |
| 23 class WebActivity : public Activity, | 24 class WebActivity : public Activity, |
| 24 public ActivityViewModel, | 25 public ActivityViewModel, |
| 25 public content::WebContentsObserver { | 26 public content::WebContentsObserver { |
| 26 public: | 27 public: |
| 27 WebActivity(content::BrowserContext* context, const GURL& gurl); | 28 WebActivity(content::BrowserContext* context, const GURL& gurl); |
| 28 virtual ~WebActivity(); | 29 virtual ~WebActivity(); |
| 29 | 30 |
| 30 protected: | 31 protected: |
| 31 // Activity: | 32 // Activity: |
| 32 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; | 33 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; |
| 33 | 34 |
| 34 // ActivityViewModel: | 35 // ActivityViewModel: |
| 35 virtual void Init() OVERRIDE; | 36 virtual void Init() OVERRIDE; |
| 36 virtual SkColor GetRepresentativeColor() OVERRIDE; | 37 virtual SkColor GetRepresentativeColor() const OVERRIDE; |
| 37 virtual base::string16 GetTitle() OVERRIDE; | 38 virtual base::string16 GetTitle() const OVERRIDE; |
| 39 virtual bool UsesFrame() const OVERRIDE; |
| 38 virtual views::View* GetContentsView() OVERRIDE; | 40 virtual views::View* GetContentsView() OVERRIDE; |
| 39 | 41 |
| 40 // content::WebContentsObserver: | 42 // content::WebContentsObserver: |
| 41 virtual void TitleWasSet(content::NavigationEntry* entry, | 43 virtual void TitleWasSet(content::NavigationEntry* entry, |
| 42 bool explicit_set) OVERRIDE; | 44 bool explicit_set) OVERRIDE; |
| 43 virtual void DidUpdateFaviconURL( | 45 virtual void DidUpdateFaviconURL( |
| 44 const std::vector<content::FaviconURL>& candidates) OVERRIDE; | 46 const std::vector<content::FaviconURL>& candidates) OVERRIDE; |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 content::BrowserContext* browser_context_; | 49 content::BrowserContext* browser_context_; |
| 48 content::WebContents* web_contents_; | |
| 49 const GURL url_; | 50 const GURL url_; |
| 50 views::WebView* web_view_; | 51 views::WebView* web_view_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(WebActivity); | 53 DISALLOW_COPY_AND_ASSIGN(WebActivity); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace athena | 56 } // namespace athena |
| 56 | 57 |
| 57 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ | 58 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ |
| OLD | NEW |