OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_SHELL_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public BaseWindow { | 34 public BaseWindow { |
35 public: | 35 public: |
36 static ShellWindow* Create(Profile* profile, | 36 static ShellWindow* Create(Profile* profile, |
37 const Extension* extension, | 37 const Extension* extension, |
38 const GURL& url); | 38 const GURL& url); |
39 | 39 |
40 const SessionID& session_id() const { return session_id_; } | 40 const SessionID& session_id() const { return session_id_; } |
41 const ExtensionWindowController* extension_window_controller() const { | 41 const ExtensionWindowController* extension_window_controller() const { |
42 return extension_window_controller_.get(); | 42 return extension_window_controller_.get(); |
43 } | 43 } |
| 44 const Extension* extension() const { return extension_; } |
44 | 45 |
45 protected: | 46 protected: |
46 // TODO(mihaip): Switch from hardcoded defaults to passing in the window | 47 // TODO(mihaip): Switch from hardcoded defaults to passing in the window |
47 // creation parameters to ShellWindow::Create. | 48 // creation parameters to ShellWindow::Create. |
48 static const int kDefaultWidth = 512; | 49 static const int kDefaultWidth = 512; |
49 static const int kDefaultHeight = 384; | 50 static const int kDefaultHeight = 384; |
50 | 51 |
51 ShellWindow(Profile* profile, | 52 ShellWindow(Profile* profile, |
52 const Extension* extension, | 53 const Extension* extension, |
53 const GURL& url); | 54 const GURL& url); |
54 virtual ~ShellWindow(); | 55 virtual ~ShellWindow(); |
55 | 56 |
56 const Extension* extension() const { return extension_; } | |
57 content::WebContents* web_contents() const { return web_contents_; } | 57 content::WebContents* web_contents() const { return web_contents_; } |
58 | 58 |
59 private: | 59 private: |
60 // PlatformAppBrowserTest needs access to web_contents() | 60 // PlatformAppBrowserTest needs access to web_contents() |
61 friend class PlatformAppBrowserTest; | 61 friend class PlatformAppBrowserTest; |
62 | 62 |
63 // Instantiates a platform-specific ShellWindow subclass (one implementation | 63 // Instantiates a platform-specific ShellWindow subclass (one implementation |
64 // per platform). Public users of ShellWindow should use ShellWindow::Create. | 64 // per platform). Public users of ShellWindow should use ShellWindow::Create. |
65 static ShellWindow* CreateImpl(Profile* profile, | 65 static ShellWindow* CreateImpl(Profile* profile, |
66 const Extension* extension, | 66 const Extension* extension, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // web_contents_ is owned by contents_wrapper_. | 99 // web_contents_ is owned by contents_wrapper_. |
100 content::WebContents* web_contents_; | 100 content::WebContents* web_contents_; |
101 content::NotificationRegistrar registrar_; | 101 content::NotificationRegistrar registrar_; |
102 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 102 scoped_ptr<ExtensionWindowController> extension_window_controller_; |
103 ExtensionFunctionDispatcher extension_function_dispatcher_; | 103 ExtensionFunctionDispatcher extension_function_dispatcher_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 105 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
106 }; | 106 }; |
107 | 107 |
108 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 108 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |