Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / apps / chrome_app_delegate.h
index 38cb882..8de0390 100644 (file)
@@ -5,8 +5,11 @@
 #ifndef CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_
 #define CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_
 
-#include "apps/app_delegate.h"
+#include "base/callback.h"
 #include "base/memory/scoped_ptr.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/app_window/app_delegate.h"
 #include "ui/base/window_open_disposition.h"
 #include "ui/gfx/rect.h"
 
@@ -15,9 +18,14 @@ class BrowserContext;
 class WebContents;
 }
 
-class ChromeAppDelegate : public apps::AppDelegate {
+class ScopedKeepAlive;
+
+class ChromeAppDelegate : public extensions::AppDelegate,
+                          public content::NotificationObserver {
  public:
-  ChromeAppDelegate();
+  // Pass a ScopedKeepAlive to prevent the browser process from shutting down
+  // while this object exists.
+  explicit ChromeAppDelegate(scoped_ptr<ScopedKeepAlive> keep_alive);
   virtual ~ChromeAppDelegate();
 
   static void DisableExternalOpenForTesting();
@@ -25,8 +33,10 @@ class ChromeAppDelegate : public apps::AppDelegate {
  private:
   class NewWindowContentsDelegate;
 
-  // apps::AppDelegate:
+  // extensions::AppDelegate:
   virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE;
+  virtual void ResizeWebContents(content::WebContents* web_contents,
+                                 const gfx::Size& size) OVERRIDE;
   virtual content::WebContents* OpenURLFromTab(
       content::BrowserContext* context,
       content::WebContents* source,
@@ -48,13 +58,27 @@ class ChromeAppDelegate : public apps::AppDelegate {
       const content::MediaStreamRequest& request,
       const content::MediaResponseCallback& callback,
       const extensions::Extension* extension) OVERRIDE;
+  virtual bool CheckMediaAccessPermission(
+      content::WebContents* web_contents,
+      const GURL& security_origin,
+      content::MediaStreamType type,
+      const extensions::Extension* extension) OVERRIDE;
   virtual int PreferredIconSize() OVERRIDE;
   virtual void SetWebContentsBlocked(content::WebContents* web_contents,
                                      bool blocked) OVERRIDE;
   virtual bool IsWebContentsVisible(
       content::WebContents* web_contents) OVERRIDE;
+  virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE;
+
+  // content::NotificationObserver:
+  virtual void Observe(int type,
+                       const content::NotificationSource& source,
+                       const content::NotificationDetails& details) OVERRIDE;
 
+  scoped_ptr<ScopedKeepAlive> keep_alive_;
   scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_;
+  base::Closure terminating_callback_;
+  content::NotificationRegistrar registrar_;
 
   DISALLOW_COPY_AND_ASSIGN(ChromeAppDelegate);
 };