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_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 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 10 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
11 #include "chrome/browser/sessions/session_id.h" | 11 #include "chrome/browser/sessions/session_id.h" |
12 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 12 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
16 #include "content/public/common/console_message_level.h" | 16 #include "content/public/common/console_message_level.h" |
17 #include "ui/base/ui_base_types.h" // WindowShowState | 17 #include "ui/base/ui_base_types.h" // WindowShowState |
18 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
20 | 20 |
21 class GURL; | 21 class GURL; |
22 class Profile; | 22 class Profile; |
23 class NativeAppWindow; | |
24 class SkRegion; | 23 class SkRegion; |
25 | 24 |
26 namespace content { | 25 namespace content { |
27 class WebContents; | 26 class WebContents; |
28 } | 27 } |
29 | 28 |
30 namespace extensions { | 29 namespace extensions { |
31 class Extension; | 30 class Extension; |
32 class PlatformAppBrowserTest; | 31 class PlatformAppBrowserTest; |
33 class WindowController; | 32 class WindowController; |
34 | 33 |
35 struct DraggableRegion; | 34 struct DraggableRegion; |
36 } | 35 } |
37 | 36 |
38 namespace ui { | 37 namespace ui { |
39 class BaseWindow; | 38 class BaseWindow; |
40 } | 39 } |
41 | 40 |
42 namespace apps { | 41 namespace apps { |
43 | 42 |
43 class NativeAppWindow; | |
44 | |
44 // Manages the web contents for Shell Windows. The implementation for this | 45 // Manages the web contents for Shell Windows. The implementation for this |
45 // class should create and maintain the WebContents for the window, and handle | 46 // class should create and maintain the WebContents for the window, and handle |
46 // any message passing between the web contents and the extension system or | 47 // any message passing between the web contents and the extension system or |
47 // native window. | 48 // native window. |
48 class ShellWindowContents { | 49 class ShellWindowContents { |
49 public: | 50 public: |
50 ShellWindowContents() {} | 51 ShellWindowContents() {} |
51 virtual ~ShellWindowContents() {} | 52 virtual ~ShellWindowContents() {} |
52 | 53 |
53 // Called to initialize the WebContents, before the app window is created. | 54 // Called to initialize the WebContents, before the app window is created. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 // If true, the window will be focused on creation. Defaults to true. | 122 // If true, the window will be focused on creation. Defaults to true. |
122 bool focused; | 123 bool focused; |
123 }; | 124 }; |
124 | 125 |
125 class Delegate { | 126 class Delegate { |
126 public: | 127 public: |
127 virtual ~Delegate(); | 128 virtual ~Delegate(); |
128 | 129 |
129 // General initialization. | 130 // General initialization. |
130 virtual void InitWebContents(content::WebContents* web_contents) = 0; | 131 virtual void InitWebContents(content::WebContents* web_contents) = 0; |
132 virtual NativeAppWindow* CreateNativeAppWindow( | |
133 ShellWindow* window, | |
134 const ShellWindow::CreateParams& params) = 0; | |
tapted
2013/08/01 07:18:59
maybe remove the extra ShellWindow:: on CreatePara
benwells
2013/08/01 08:19:39
Done.
| |
131 | 135 |
132 // Link handling. | 136 // Link handling. |
133 virtual content::WebContents* OpenURLFromTab( | 137 virtual content::WebContents* OpenURLFromTab( |
134 Profile* profile, | 138 Profile* profile, |
135 content::WebContents* source, | 139 content::WebContents* source, |
136 const content::OpenURLParams& params) = 0; | 140 const content::OpenURLParams& params) = 0; |
137 virtual void AddNewContents(Profile* profile, | 141 virtual void AddNewContents(Profile* profile, |
138 content::WebContents* new_contents, | 142 content::WebContents* new_contents, |
139 WindowOpenDisposition disposition, | 143 WindowOpenDisposition disposition, |
140 const gfx::Rect& initial_pos, | 144 const gfx::Rect& initial_pos, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 bool fullscreen_for_window_api_; | 367 bool fullscreen_for_window_api_; |
364 // Fullscreen entered by HTML requestFullscreen. | 368 // Fullscreen entered by HTML requestFullscreen. |
365 bool fullscreen_for_tab_; | 369 bool fullscreen_for_tab_; |
366 | 370 |
367 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 371 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
368 }; | 372 }; |
369 | 373 |
370 } // namespace apps | 374 } // namespace apps |
371 | 375 |
372 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 376 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |