| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 6 #define EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 class GURL; | 28 class GURL; |
| 29 class SkRegion; | 29 class SkRegion; |
| 30 | 30 |
| 31 namespace base { | 31 namespace base { |
| 32 class DictionaryValue; | 32 class DictionaryValue; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 class BrowserContext; | 36 class BrowserContext; |
| 37 class RenderFrameHost; |
| 37 class WebContents; | 38 class WebContents; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace extensions { | 41 namespace extensions { |
| 41 | 42 |
| 42 class AppDelegate; | 43 class AppDelegate; |
| 43 class AppWebContentsHelper; | 44 class AppWebContentsHelper; |
| 44 class Extension; | 45 class Extension; |
| 45 class NativeAppWindow; | 46 class NativeAppWindow; |
| 46 class PlatformAppBrowserTest; | 47 class PlatformAppBrowserTest; |
| 47 | 48 |
| 48 struct DraggableRegion; | 49 struct DraggableRegion; |
| 49 | 50 |
| 50 // Manages the web contents for app windows. The implementation for this | 51 // Manages the web contents for app windows. The implementation for this |
| 51 // class should create and maintain the WebContents for the window, and handle | 52 // class should create and maintain the WebContents for the window, and handle |
| 52 // any message passing between the web contents and the extension system or | 53 // any message passing between the web contents and the extension system or |
| 53 // native window. | 54 // native window. |
| 54 class AppWindowContents { | 55 class AppWindowContents { |
| 55 public: | 56 public: |
| 56 AppWindowContents() {} | 57 AppWindowContents() {} |
| 57 virtual ~AppWindowContents() {} | 58 virtual ~AppWindowContents() {} |
| 58 | 59 |
| 59 // Called to initialize the WebContents, before the app window is created. | 60 // Called to initialize the WebContents, before the app window is created. |
| 60 virtual void Initialize(content::BrowserContext* context, | 61 virtual void Initialize(content::BrowserContext* context, |
| 62 content::RenderFrameHost* creator_frame, |
| 61 const GURL& url) = 0; | 63 const GURL& url) = 0; |
| 62 | 64 |
| 63 // Called to load the contents, after the app window is created. | 65 // Called to load the contents, after the app window is created. |
| 64 virtual void LoadContents(int32_t creator_process_id) = 0; | 66 virtual void LoadContents(int32_t creator_process_id) = 0; |
| 65 | 67 |
| 66 // Called when the native window changes. | 68 // Called when the native window changes. |
| 67 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; | 69 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; |
| 68 | 70 |
| 69 // Called when the native window closes. | 71 // Called when the native window closes. |
| 70 virtual void NativeWindowClosed() = 0; | 72 virtual void NativeWindowClosed() = 0; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // Normally AppWindow::Create should be used. | 214 // Normally AppWindow::Create should be used. |
| 213 // Takes ownership of |app_delegate| and |delegate|. | 215 // Takes ownership of |app_delegate| and |delegate|. |
| 214 AppWindow(content::BrowserContext* context, | 216 AppWindow(content::BrowserContext* context, |
| 215 AppDelegate* app_delegate, | 217 AppDelegate* app_delegate, |
| 216 const Extension* extension); | 218 const Extension* extension); |
| 217 | 219 |
| 218 // Initializes the render interface, web contents, and native window. | 220 // Initializes the render interface, web contents, and native window. |
| 219 // |app_window_contents| will become owned by AppWindow. | 221 // |app_window_contents| will become owned by AppWindow. |
| 220 void Init(const GURL& url, | 222 void Init(const GURL& url, |
| 221 AppWindowContents* app_window_contents, | 223 AppWindowContents* app_window_contents, |
| 224 content::RenderFrameHost* creator_frame, |
| 222 const CreateParams& params); | 225 const CreateParams& params); |
| 223 | 226 |
| 224 const std::string& window_key() const { return window_key_; } | 227 const std::string& window_key() const { return window_key_; } |
| 225 const SessionID& session_id() const { return session_id_; } | 228 const SessionID& session_id() const { return session_id_; } |
| 226 const std::string& extension_id() const { return extension_id_; } | 229 const std::string& extension_id() const { return extension_id_; } |
| 227 content::WebContents* web_contents() const; | 230 content::WebContents* web_contents() const; |
| 228 WindowType window_type() const { return window_type_; } | 231 WindowType window_type() const { return window_type_; } |
| 229 bool window_type_is_panel() const { | 232 bool window_type_is_panel() const { |
| 230 return (window_type_ == WINDOW_TYPE_PANEL || | 233 return (window_type_ == WINDOW_TYPE_PANEL || |
| 231 window_type_ == WINDOW_TYPE_V1_PANEL); | 234 window_type_ == WINDOW_TYPE_V1_PANEL); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 base::Closure on_first_commit_callback_; | 570 base::Closure on_first_commit_callback_; |
| 568 | 571 |
| 569 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 572 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 570 | 573 |
| 571 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 574 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 572 }; | 575 }; |
| 573 | 576 |
| 574 } // namespace extensions | 577 } // namespace extensions |
| 575 | 578 |
| 576 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 579 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| OLD | NEW |