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 26 matching lines...) Expand all Loading... |
37 public BaseWindow { | 37 public BaseWindow { |
38 public: | 38 public: |
39 static ShellWindow* Create(Profile* profile, | 39 static ShellWindow* Create(Profile* profile, |
40 const extensions::Extension* extension, | 40 const extensions::Extension* extension, |
41 const GURL& url); | 41 const GURL& url); |
42 | 42 |
43 const SessionID& session_id() const { return session_id_; } | 43 const SessionID& session_id() const { return session_id_; } |
44 const ExtensionWindowController* extension_window_controller() const { | 44 const ExtensionWindowController* extension_window_controller() const { |
45 return extension_window_controller_.get(); | 45 return extension_window_controller_.get(); |
46 } | 46 } |
| 47 const extensions::Extension* extension() const { return extension_; } |
47 | 48 |
48 protected: | 49 protected: |
49 // TODO(mihaip): Switch from hardcoded defaults to passing in the window | 50 // TODO(mihaip): Switch from hardcoded defaults to passing in the window |
50 // creation parameters to ShellWindow::Create. | 51 // creation parameters to ShellWindow::Create. |
51 static const int kDefaultWidth = 512; | 52 static const int kDefaultWidth = 512; |
52 static const int kDefaultHeight = 384; | 53 static const int kDefaultHeight = 384; |
53 | 54 |
54 ShellWindow(Profile* profile, | 55 ShellWindow(Profile* profile, |
55 const extensions::Extension* extension, | 56 const extensions::Extension* extension, |
56 const GURL& url); | 57 const GURL& url); |
57 virtual ~ShellWindow(); | 58 virtual ~ShellWindow(); |
58 | 59 |
59 const extensions::Extension* extension() const { return extension_; } | |
60 content::WebContents* web_contents() const { return web_contents_; } | 60 content::WebContents* web_contents() const { return web_contents_; } |
61 | 61 |
62 private: | 62 private: |
63 // PlatformAppBrowserTest needs access to web_contents() | 63 // PlatformAppBrowserTest needs access to web_contents() |
64 friend class PlatformAppBrowserTest; | 64 friend class PlatformAppBrowserTest; |
65 | 65 |
66 // Instantiates a platform-specific ShellWindow subclass (one implementation | 66 // Instantiates a platform-specific ShellWindow subclass (one implementation |
67 // per platform). Public users of ShellWindow should use ShellWindow::Create. | 67 // per platform). Public users of ShellWindow should use ShellWindow::Create. |
68 static ShellWindow* CreateImpl(Profile* profile, | 68 static ShellWindow* CreateImpl(Profile* profile, |
69 const extensions::Extension* extension, | 69 const extensions::Extension* extension, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // web_contents_ is owned by contents_wrapper_. | 103 // web_contents_ is owned by contents_wrapper_. |
104 content::WebContents* web_contents_; | 104 content::WebContents* web_contents_; |
105 content::NotificationRegistrar registrar_; | 105 content::NotificationRegistrar registrar_; |
106 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 106 scoped_ptr<ExtensionWindowController> extension_window_controller_; |
107 ExtensionFunctionDispatcher extension_function_dispatcher_; | 107 ExtensionFunctionDispatcher extension_function_dispatcher_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 109 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
110 }; | 110 }; |
111 | 111 |
112 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 112 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |