OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_APP_WINDOW_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_WINDOW_CONTENTS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_APP_WINDOW_CONTENTS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_APP_WINDOW_CONTENTS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 13 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class BrowserContext; | |
James Cook
2014/02/12 00:46:41
totally optional nit: I usually don't forward-decl
Ken Rockot(use gerrit already)
2014/02/12 01:05:46
I can support that. Done.
| |
20 class RenderViewHost; | 21 class RenderViewHost; |
21 } | 22 } |
22 | 23 |
23 namespace extensions { | 24 namespace extensions { |
24 struct DraggableRegion; | 25 struct DraggableRegion; |
25 } | 26 } |
26 | 27 |
27 namespace apps { | 28 namespace apps { |
28 | 29 |
29 // ShellWindowContents class specific to app windows. It maintains a | 30 // ShellWindowContents class specific to app windows. It maintains a |
30 // WebContents instance and observes it for the purpose of passing | 31 // WebContents instance and observes it for the purpose of passing |
31 // messages to the extensions system. | 32 // messages to the extensions system. |
32 class AppWindowContents : public ShellWindowContents, | 33 class AppWindowContents : public ShellWindowContents, |
33 public content::NotificationObserver, | 34 public content::NotificationObserver, |
34 public content::WebContentsObserver, | 35 public content::WebContentsObserver, |
35 public ExtensionFunctionDispatcher::Delegate { | 36 public ExtensionFunctionDispatcher::Delegate { |
36 public: | 37 public: |
37 explicit AppWindowContents(ShellWindow* host); | 38 explicit AppWindowContents(ShellWindow* host); |
38 virtual ~AppWindowContents(); | 39 virtual ~AppWindowContents(); |
39 | 40 |
40 // ShellWindowContents | 41 // ShellWindowContents |
41 virtual void Initialize(Profile* profile, const GURL& url) OVERRIDE; | 42 virtual void Initialize(content::BrowserContext* context, |
43 const GURL& url) OVERRIDE; | |
42 virtual void LoadContents(int32 creator_process_id) OVERRIDE; | 44 virtual void LoadContents(int32 creator_process_id) OVERRIDE; |
43 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) OVERRIDE; | 45 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) OVERRIDE; |
44 virtual void NativeWindowClosed() OVERRIDE; | 46 virtual void NativeWindowClosed() OVERRIDE; |
45 virtual content::WebContents* GetWebContents() const OVERRIDE; | 47 virtual content::WebContents* GetWebContents() const OVERRIDE; |
46 | 48 |
47 private: | 49 private: |
48 // content::NotificationObserver | 50 // content::NotificationObserver |
49 virtual void Observe(int type, | 51 virtual void Observe(int type, |
50 const content::NotificationSource& source, | 52 const content::NotificationSource& source, |
51 const content::NotificationDetails& details) OVERRIDE; | 53 const content::NotificationDetails& details) OVERRIDE; |
(...skipping 16 matching lines...) Expand all Loading... | |
68 content::NotificationRegistrar registrar_; | 70 content::NotificationRegistrar registrar_; |
69 scoped_ptr<content::WebContents> web_contents_; | 71 scoped_ptr<content::WebContents> web_contents_; |
70 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 72 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); | 74 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); |
73 }; | 75 }; |
74 | 76 |
75 } // namespace apps | 77 } // namespace apps |
76 | 78 |
77 #endif // CHROME_BROWSER_EXTENSIONS_APP_WINDOW_CONTENTS_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_APP_WINDOW_CONTENTS_H_ |
OLD | NEW |