Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: athena/content/web_activity.h

Issue 358003002: Additions to Activities to allow resource management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « athena/content/app_activity.cc ('k') | athena/content/web_activity.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/gfx/image/image_skia.h"
11 12
12 namespace content { 13 namespace content {
13 class BrowserContext; 14 class BrowserContext;
14 class WebContents; 15 class WebContents;
15 } 16 }
16 17
17 namespace views { 18 namespace views {
18 class WebView; 19 class WebView;
19 class WidgetDelegate; 20 class WidgetDelegate;
20 } 21 }
21 22
22 namespace athena { 23 namespace athena {
23 24
25 class AthenaWebView;
26
24 class WebActivity : public Activity, 27 class WebActivity : public Activity,
25 public ActivityViewModel, 28 public ActivityViewModel,
26 public content::WebContentsObserver { 29 public content::WebContentsObserver {
27 public: 30 public:
28 WebActivity(content::BrowserContext* context, const GURL& gurl); 31 WebActivity(content::BrowserContext* context, const GURL& gurl);
29 virtual ~WebActivity(); 32 virtual ~WebActivity();
30 33
31 protected: 34 protected:
32 // Activity: 35 // Activity:
33 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE; 36 virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE;
37 virtual void SetCurrentState(ActivityState state) OVERRIDE;
38 virtual ActivityState GetCurrentState() OVERRIDE;
39 virtual bool IsVisible() OVERRIDE;
40 virtual ActivityMediaState GetMediaState() OVERRIDE;
34 41
35 // ActivityViewModel: 42 // ActivityViewModel:
36 virtual void Init() OVERRIDE; 43 virtual void Init() OVERRIDE;
37 virtual SkColor GetRepresentativeColor() const OVERRIDE; 44 virtual SkColor GetRepresentativeColor() const OVERRIDE;
38 virtual base::string16 GetTitle() const OVERRIDE; 45 virtual base::string16 GetTitle() const OVERRIDE;
39 virtual bool UsesFrame() const OVERRIDE; 46 virtual bool UsesFrame() const OVERRIDE;
40 virtual views::View* GetContentsView() OVERRIDE; 47 virtual views::View* GetContentsView() OVERRIDE;
48 virtual void CreateOverviewModeImage() OVERRIDE;
49 virtual gfx::ImageSkia GetOverviewModeImage() OVERRIDE;
41 50
42 // content::WebContentsObserver: 51 // content::WebContentsObserver:
43 virtual void TitleWasSet(content::NavigationEntry* entry, 52 virtual void TitleWasSet(content::NavigationEntry* entry,
44 bool explicit_set) OVERRIDE; 53 bool explicit_set) OVERRIDE;
45 virtual void DidUpdateFaviconURL( 54 virtual void DidUpdateFaviconURL(
46 const std::vector<content::FaviconURL>& candidates) OVERRIDE; 55 const std::vector<content::FaviconURL>& candidates) OVERRIDE;
47 56
48 private: 57 private:
49 content::BrowserContext* browser_context_; 58 content::BrowserContext* browser_context_;
50 const GURL url_; 59 const GURL url_;
51 views::WebView* web_view_; 60 AthenaWebView* web_view_;
61
62 // The current state for this activity.
63 ActivityState current_state_;
64
65 // The image which will be used in overview mode.
66 gfx::ImageSkia overview_mode_image_;
52 67
53 DISALLOW_COPY_AND_ASSIGN(WebActivity); 68 DISALLOW_COPY_AND_ASSIGN(WebActivity);
54 }; 69 };
55 70
56 } // namespace athena 71 } // namespace athena
57 72
58 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_ 73 #endif // ATHENA_CONTENT_WEB_ACTIVITY_H_
OLDNEW
« no previous file with comments | « athena/content/app_activity.cc ('k') | athena/content/web_activity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698