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 CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "content/public/browser/notification_observer.h" | |
11 #include "content/public/browser/notification_registrar.h" | |
12 #include "extensions/browser/app_window/app_delegate.h" | 8 #include "extensions/browser/app_window/app_delegate.h" |
13 #include "ui/base/window_open_disposition.h" | |
14 #include "ui/gfx/rect.h" | |
15 | 9 |
16 namespace content { | 10 namespace extensions { |
17 class BrowserContext; | |
18 class WebContents; | |
19 } | |
20 | 11 |
21 class ChromeAppDelegate : public extensions::AppDelegate, | 12 class ShellAppDelegate : public AppDelegate { |
James Cook
2014/09/05 16:26:42
Can you add a brief comment about this class?
hashimoto
2014/09/05 17:37:17
Done.
| |
22 public content::NotificationObserver { | |
23 public: | 13 public: |
24 ChromeAppDelegate(); | 14 ShellAppDelegate(); |
25 virtual ~ChromeAppDelegate(); | 15 virtual ~ShellAppDelegate(); |
26 | 16 |
27 static void DisableExternalOpenForTesting(); | 17 // AppsClient overrides: |
James Cook
2014/09/05 16:26:42
AppDelegate overrides?
hashimoto
2014/09/05 17:37:17
Oops, done.
| |
28 | |
29 private: | |
30 class NewWindowContentsDelegate; | |
31 | |
32 // extensions::AppDelegate: | |
33 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; | 18 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; |
34 virtual void ResizeWebContents(content::WebContents* web_contents, | 19 virtual void ResizeWebContents(content::WebContents* web_contents, |
35 const gfx::Size& size) OVERRIDE; | 20 const gfx::Size& size) OVERRIDE; |
36 virtual content::WebContents* OpenURLFromTab( | 21 virtual content::WebContents* OpenURLFromTab( |
37 content::BrowserContext* context, | 22 content::BrowserContext* context, |
38 content::WebContents* source, | 23 content::WebContents* source, |
39 const content::OpenURLParams& params) OVERRIDE; | 24 const content::OpenURLParams& params) OVERRIDE; |
40 virtual void AddNewContents(content::BrowserContext* context, | 25 virtual void AddNewContents(content::BrowserContext* context, |
41 content::WebContents* new_contents, | 26 content::WebContents* new_contents, |
42 WindowOpenDisposition disposition, | 27 WindowOpenDisposition disposition, |
43 const gfx::Rect& initial_pos, | 28 const gfx::Rect& initial_pos, |
44 bool user_gesture, | 29 bool user_gesture, |
45 bool* was_blocked) OVERRIDE; | 30 bool* was_blocked) OVERRIDE; |
46 virtual content::ColorChooser* ShowColorChooser( | 31 virtual content::ColorChooser* ShowColorChooser( |
47 content::WebContents* web_contents, | 32 content::WebContents* web_contents, |
48 SkColor initial_color) OVERRIDE; | 33 SkColor initial_color) OVERRIDE; |
49 virtual void RunFileChooser( | 34 virtual void RunFileChooser( |
50 content::WebContents* tab, | 35 content::WebContents* tab, |
51 const content::FileChooserParams& params) OVERRIDE; | 36 const content::FileChooserParams& params) OVERRIDE; |
52 virtual void RequestMediaAccessPermission( | 37 virtual void RequestMediaAccessPermission( |
53 content::WebContents* web_contents, | 38 content::WebContents* web_contents, |
54 const content::MediaStreamRequest& request, | 39 const content::MediaStreamRequest& request, |
55 const content::MediaResponseCallback& callback, | 40 const content::MediaResponseCallback& callback, |
56 const extensions::Extension* extension) OVERRIDE; | 41 const Extension* extension) OVERRIDE; |
57 virtual int PreferredIconSize() OVERRIDE; | 42 virtual int PreferredIconSize() OVERRIDE; |
58 virtual gfx::ImageSkia GetAppDefaultIcon() OVERRIDE; | 43 virtual gfx::ImageSkia GetAppDefaultIcon() OVERRIDE; |
59 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 44 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
60 bool blocked) OVERRIDE; | 45 bool blocked) OVERRIDE; |
61 virtual bool IsWebContentsVisible( | 46 virtual bool IsWebContentsVisible( |
62 content::WebContents* web_contents) OVERRIDE; | 47 content::WebContents* web_contents) OVERRIDE; |
63 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE; | 48 virtual void SetTerminatingCallback(const base::Closure& callback) OVERRIDE; |
64 | 49 |
65 // content::NotificationObserver: | 50 private: |
66 virtual void Observe(int type, | 51 DISALLOW_COPY_AND_ASSIGN(ShellAppDelegate); |
67 const content::NotificationSource& source, | |
68 const content::NotificationDetails& details) OVERRIDE; | |
69 | |
70 scoped_ptr<NewWindowContentsDelegate> new_window_contents_delegate_; | |
71 base::Closure terminating_callback_; | |
72 content::NotificationRegistrar registrar_; | |
73 | |
74 DISALLOW_COPY_AND_ASSIGN(ChromeAppDelegate); | |
75 }; | 52 }; |
76 | 53 |
77 #endif // CHROME_BROWSER_UI_APPS_CHROME_APP_DELEGATE_H_ | 54 } // namespace extensions |
55 | |
56 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_APP_DELEGATE_H_ | |
OLD | NEW |