| 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; | |
| 25 class SkRegion; | 24 class SkRegion; |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class WebContents; | 27 class WebContents; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace extensions { | 30 namespace extensions { |
| 32 class Extension; | 31 class Extension; |
| 33 class PlatformAppBrowserTest; | 32 class PlatformAppBrowserTest; |
| 34 class WindowController; | 33 class WindowController; |
| 35 | 34 |
| 36 struct DraggableRegion; | 35 struct DraggableRegion; |
| 37 } | 36 } |
| 38 | 37 |
| 39 namespace ui { | 38 namespace ui { |
| 40 class BaseWindow; | 39 class BaseWindow; |
| 41 } | 40 } |
| 42 | 41 |
| 43 namespace apps { | 42 namespace apps { |
| 44 | 43 |
| 44 class NativeAppWindow; |
| 45 |
| 45 // Manages the web contents for Shell Windows. The implementation for this | 46 // Manages the web contents for Shell Windows. The implementation for this |
| 46 // class should create and maintain the WebContents for the window, and handle | 47 // class should create and maintain the WebContents for the window, and handle |
| 47 // any message passing between the web contents and the extension system or | 48 // any message passing between the web contents and the extension system or |
| 48 // native window. | 49 // native window. |
| 49 class ShellWindowContents { | 50 class ShellWindowContents { |
| 50 public: | 51 public: |
| 51 ShellWindowContents() {} | 52 ShellWindowContents() {} |
| 52 virtual ~ShellWindowContents() {} | 53 virtual ~ShellWindowContents() {} |
| 53 | 54 |
| 54 // Called to initialize the WebContents, before the app window is created. | 55 // Called to initialize the WebContents, before the app window is created. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // If true, the window will be focused on creation. Defaults to true. | 124 // If true, the window will be focused on creation. Defaults to true. |
| 124 bool focused; | 125 bool focused; |
| 125 }; | 126 }; |
| 126 | 127 |
| 127 class Delegate { | 128 class Delegate { |
| 128 public: | 129 public: |
| 129 virtual ~Delegate(); | 130 virtual ~Delegate(); |
| 130 | 131 |
| 131 // General initialization. | 132 // General initialization. |
| 132 virtual void InitWebContents(content::WebContents* web_contents) = 0; | 133 virtual void InitWebContents(content::WebContents* web_contents) = 0; |
| 134 virtual NativeAppWindow* CreateNativeAppWindow( |
| 135 ShellWindow* window, |
| 136 const CreateParams& params) = 0; |
| 133 | 137 |
| 134 // Link handling. | 138 // Link handling. |
| 135 virtual content::WebContents* OpenURLFromTab( | 139 virtual content::WebContents* OpenURLFromTab( |
| 136 Profile* profile, | 140 Profile* profile, |
| 137 content::WebContents* source, | 141 content::WebContents* source, |
| 138 const content::OpenURLParams& params) = 0; | 142 const content::OpenURLParams& params) = 0; |
| 139 virtual void AddNewContents(Profile* profile, | 143 virtual void AddNewContents(Profile* profile, |
| 140 content::WebContents* new_contents, | 144 content::WebContents* new_contents, |
| 141 WindowOpenDisposition disposition, | 145 WindowOpenDisposition disposition, |
| 142 const gfx::Rect& initial_pos, | 146 const gfx::Rect& initial_pos, |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 bool fullscreen_for_window_api_; | 374 bool fullscreen_for_window_api_; |
| 371 // Fullscreen entered by HTML requestFullscreen. | 375 // Fullscreen entered by HTML requestFullscreen. |
| 372 bool fullscreen_for_tab_; | 376 bool fullscreen_for_tab_; |
| 373 | 377 |
| 374 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 378 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
| 375 }; | 379 }; |
| 376 | 380 |
| 377 } // namespace apps | 381 } // namespace apps |
| 378 | 382 |
| 379 #endif // APPS_SHELL_WINDOW_H_ | 383 #endif // APPS_SHELL_WINDOW_H_ |
| OLD | NEW |