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