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 EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ | 5 #ifndef ATHENA_EXTENSIONS_CHROME_ATHENA_APP_DELEGATE_H_ |
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ | 6 #define ATHENA_EXTENSIONS_CHROME_ATHENA_APP_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback.h" | |
Jun Mukai
2014/09/10 00:07:11
base/callback_forward.h would be more preferable.
oshima
2014/09/10 00:47:50
This is necessary to have terminating_callback_ me
| |
9 #include "base/memory/scoped_ptr.h" | |
8 #include "extensions/browser/app_window/app_delegate.h" | 10 #include "extensions/browser/app_window/app_delegate.h" |
11 #include "ui/base/window_open_disposition.h" | |
9 | 12 |
10 namespace extensions { | 13 namespace athena { |
11 | 14 |
12 // app_shell's AppDelegate implementation. | 15 class AthenaAppDelegate : public extensions::AppDelegate { |
13 class ShellAppDelegate : public AppDelegate { | |
14 public: | 16 public: |
15 ShellAppDelegate(); | 17 AthenaAppDelegate(); |
16 virtual ~ShellAppDelegate(); | 18 virtual ~AthenaAppDelegate(); |
17 | 19 |
18 // AppDelegate overrides: | 20 private: |
21 class NewWindowContentsDelegate; | |
22 | |
23 // extensions::AppDelegate: | |
19 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; | 24 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; |
20 virtual void ResizeWebContents(content::WebContents* web_contents, | 25 virtual void ResizeWebContents(content::WebContents* web_contents, |
21 const gfx::Size& size) OVERRIDE; | 26 const gfx::Size& size) OVERRIDE; |
22 virtual content::WebContents* OpenURLFromTab( | 27 virtual content::WebContents* OpenURLFromTab( |
23 content::BrowserContext* context, | 28 content::BrowserContext* context, |
24 content::WebContents* source, | 29 content::WebContents* source, |
25 const content::OpenURLParams& params) OVERRIDE; | 30 const content::OpenURLParams& params) OVERRIDE; |
26 virtual void AddNewContents(content::BrowserContext* context, | 31 virtual void AddNewContents(content::BrowserContext* context, |
27 content::WebContents* new_contents, | 32 content::WebContents* new_contents, |
28 WindowOpenDisposition disposition, | 33 WindowOpenDisposition disposition, |
29 const gfx::Rect& initial_pos, | 34 const gfx::Rect& initial_pos, |
30 bool user_gesture, | 35 bool user_gesture, |
31 bool* was_blocked) OVERRIDE; | 36 bool* was_blocked) OVERRIDE; |
32 virtual content::ColorChooser* ShowColorChooser( | 37 virtual content::ColorChooser* ShowColorChooser( |
33 content::WebContents* web_contents, | 38 content::WebContents* web_contents, |
34 SkColor initial_color) OVERRIDE; | 39 SkColor initial_color) OVERRIDE; |
35 virtual void RunFileChooser( | 40 virtual void RunFileChooser( |
36 content::WebContents* tab, | 41 content::WebContents* tab, |
37 const content::FileChooserParams& params) OVERRIDE; | 42 const content::FileChooserParams& params) OVERRIDE; |
38 virtual void RequestMediaAccessPermission( | 43 virtual void RequestMediaAccessPermission( |
39 content::WebContents* web_contents, | 44 content::WebContents* web_contents, |
40 const content::MediaStreamRequest& request, | 45 const content::MediaStreamRequest& request, |
41 const content::MediaResponseCallback& callback, | 46 const content::MediaResponseCallback& callback, |
42 const Extension* extension) OVERRIDE; | 47 const extensions::Extension* extension) OVERRIDE; |
43 virtual int PreferredIconSize() OVERRIDE; | 48 virtual int PreferredIconSize() OVERRIDE; |
44 virtual gfx::ImageSkia GetAppDefaultIcon() OVERRIDE; | 49 virtual gfx::ImageSkia GetAppDefaultIcon() OVERRIDE; |
45 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 50 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
46 bool blocked) OVERRIDE; | 51 bool blocked) OVERRIDE; |
47 virtual bool IsWebContentsVisible( | 52 virtual bool IsWebContentsVisible( |
48 content::WebContents* web_contents) OVERRIDE; | 53 content::WebContents* web_contents) OVERRIDE; |
49 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE; | 54 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE; |
50 | 55 |
51 private: | 56 scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_; |
52 DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate); | 57 base::Closure terminating_callback_; |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(AthenaAppDelegate); | |
53 }; | 60 }; |
54 | 61 |
55 } // namespace extensions | 62 } // namespace athena |
56 | 63 |
57 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ | 64 #endif // ATHENA_EXTENSIONS_CHROME_ATHENA_APP_DELEGATE_H_ |
OLD | NEW |