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 APPS_SHELL_WINDOW_H_ | 5 #ifndef APPS_SHELL_WINDOW_H_ |
6 #define APPS_SHELL_WINDOW_H_ | 6 #define APPS_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_icon_image.h" | 10 #include "chrome/browser/extensions/extension_icon_image.h" |
11 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 11 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
12 #include "chrome/browser/sessions/session_id.h" | 12 #include "chrome/browser/sessions/session_id.h" |
13 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 13 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" |
17 #include "content/public/common/console_message_level.h" | 17 #include "content/public/common/console_message_level.h" |
18 #include "ui/base/ui_base_types.h" // WindowShowState | 18 #include "ui/base/ui_base_types.h" // WindowShowState |
19 #include "ui/gfx/image/image.h" | 19 #include "ui/gfx/image/image.h" |
20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
21 | 21 |
22 class GURL; | 22 class GURL; |
23 class Profile; | 23 class Profile; |
| 24 class NativeAppWindow; |
24 class SkRegion; | 25 class SkRegion; |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 class WebContents; | 28 class WebContents; |
28 } | 29 } |
29 | 30 |
30 namespace extensions { | 31 namespace extensions { |
31 class Extension; | 32 class Extension; |
32 class PlatformAppBrowserTest; | 33 class PlatformAppBrowserTest; |
33 class WindowController; | 34 class WindowController; |
34 | 35 |
35 struct DraggableRegion; | 36 struct DraggableRegion; |
36 } | 37 } |
37 | 38 |
38 namespace ui { | 39 namespace ui { |
39 class BaseWindow; | 40 class BaseWindow; |
40 } | 41 } |
41 | 42 |
42 namespace apps { | 43 namespace apps { |
43 | 44 |
44 class NativeAppWindow; | |
45 | |
46 // Manages the web contents for Shell Windows. The implementation for this | 45 // Manages the web contents for Shell Windows. The implementation for this |
47 // 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 |
48 // 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 |
49 // native window. | 48 // native window. |
50 class ShellWindowContents { | 49 class ShellWindowContents { |
51 public: | 50 public: |
52 ShellWindowContents() {} | 51 ShellWindowContents() {} |
53 virtual ~ShellWindowContents() {} | 52 virtual ~ShellWindowContents() {} |
54 | 53 |
55 // Called to initialize the WebContents, before the app window is created. | 54 // Called to initialize the WebContents, before the app window is created. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // If true, the window will be focused on creation. Defaults to true. | 123 // If true, the window will be focused on creation. Defaults to true. |
125 bool focused; | 124 bool focused; |
126 }; | 125 }; |
127 | 126 |
128 class Delegate { | 127 class Delegate { |
129 public: | 128 public: |
130 virtual ~Delegate(); | 129 virtual ~Delegate(); |
131 | 130 |
132 // General initialization. | 131 // General initialization. |
133 virtual void InitWebContents(content::WebContents* web_contents) = 0; | 132 virtual void InitWebContents(content::WebContents* web_contents) = 0; |
134 virtual NativeAppWindow* CreateNativeAppWindow( | |
135 ShellWindow* window, | |
136 const CreateParams& params) = 0; | |
137 | 133 |
138 // Link handling. | 134 // Link handling. |
139 virtual content::WebContents* OpenURLFromTab( | 135 virtual content::WebContents* OpenURLFromTab( |
140 Profile* profile, | 136 Profile* profile, |
141 content::WebContents* source, | 137 content::WebContents* source, |
142 const content::OpenURLParams& params) = 0; | 138 const content::OpenURLParams& params) = 0; |
143 virtual void AddNewContents(Profile* profile, | 139 virtual void AddNewContents(Profile* profile, |
144 content::WebContents* new_contents, | 140 content::WebContents* new_contents, |
145 WindowOpenDisposition disposition, | 141 WindowOpenDisposition disposition, |
146 const gfx::Rect& initial_pos, | 142 const gfx::Rect& initial_pos, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 bool fullscreen_for_window_api_; | 374 bool fullscreen_for_window_api_; |
379 // Fullscreen entered by HTML requestFullscreen. | 375 // Fullscreen entered by HTML requestFullscreen. |
380 bool fullscreen_for_tab_; | 376 bool fullscreen_for_tab_; |
381 | 377 |
382 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 378 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
383 }; | 379 }; |
384 | 380 |
385 } // namespace apps | 381 } // namespace apps |
386 | 382 |
387 #endif // APPS_SHELL_WINDOW_H_ | 383 #endif // APPS_SHELL_WINDOW_H_ |
OLD | NEW |