Home | History | Annotate | Download | only in content
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef ATHENA_CONTENT_PUBLIC_APP_ACTIVITY_H_
      6 #define ATHENA_CONTENT_PUBLIC_APP_ACTIVITY_H_
      7 
      8 #include "athena/activity/public/activity.h"
      9 #include "athena/activity/public/activity_view_model.h"
     10 #include "content/public/browser/web_contents_observer.h"
     11 
     12 namespace apps {
     13 class ShellAppWindow;
     14 }
     15 
     16 namespace views {
     17 class WebView;
     18 }
     19 
     20 namespace athena {
     21 
     22 class AppActivity : public Activity,
     23                     public ActivityViewModel,
     24                     public content::WebContentsObserver {
     25  public:
     26   explicit AppActivity(apps::ShellAppWindow* app_window);
     27   virtual ~AppActivity();
     28 
     29  protected:
     30   // Activity:
     31   virtual athena::ActivityViewModel* GetActivityViewModel() OVERRIDE;
     32 
     33   // ActivityViewModel:
     34   virtual void Init() OVERRIDE;
     35   virtual SkColor GetRepresentativeColor() OVERRIDE;
     36   virtual base::string16 GetTitle() OVERRIDE;
     37   virtual views::View* GetContentsView() OVERRIDE;
     38 
     39   // content::WebContentsObserver:
     40   virtual void TitleWasSet(content::NavigationEntry* entry,
     41                            bool explicit_set) OVERRIDE;
     42   virtual void DidUpdateFaviconURL(
     43       const std::vector<content::FaviconURL>& candidates) OVERRIDE;
     44 
     45  private:
     46   scoped_ptr<apps::ShellAppWindow> app_window_;
     47   views::WebView* web_view_;
     48 
     49   DISALLOW_COPY_AND_ASSIGN(AppActivity);
     50 };
     51 
     52 }  // namespace athena
     53 
     54 #endif  // ATHENA_CONTENT_APP_ACTIVITY_H_
     55