| 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 APPS_APP_WINDOW_H_ | 5 #ifndef APPS_APP_WINDOW_H_ |
| 6 #define APPS_APP_WINDOW_H_ | 6 #define APPS_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class DictionaryValue; | 29 class DictionaryValue; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 class BrowserContext; | 33 class BrowserContext; |
| 34 class WebContents; | 34 class WebContents; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace extensions { | 37 namespace extensions { |
| 38 class Extension; | 38 class Extension; |
| 39 class NativeAppWindow; |
| 39 class PlatformAppBrowserTest; | 40 class PlatformAppBrowserTest; |
| 40 class WindowController; | 41 class WindowController; |
| 41 | 42 |
| 42 struct DraggableRegion; | 43 struct DraggableRegion; |
| 43 } | 44 } |
| 44 | 45 |
| 45 namespace ui { | 46 namespace ui { |
| 46 class BaseWindow; | 47 class BaseWindow; |
| 47 } | 48 } |
| 48 | 49 |
| 49 namespace apps { | 50 namespace apps { |
| 50 | 51 |
| 51 class AppDelegate; | 52 class AppDelegate; |
| 52 class AppWebContentsHelper; | 53 class AppWebContentsHelper; |
| 53 class NativeAppWindow; | |
| 54 | 54 |
| 55 // Manages the web contents for app windows. The implementation for this | 55 // Manages the web contents for app windows. The implementation for this |
| 56 // class should create and maintain the WebContents for the window, and handle | 56 // class should create and maintain the WebContents for the window, and handle |
| 57 // any message passing between the web contents and the extension system or | 57 // any message passing between the web contents and the extension system or |
| 58 // native window. | 58 // native window. |
| 59 class AppWindowContents { | 59 class AppWindowContents { |
| 60 public: | 60 public: |
| 61 AppWindowContents() {} | 61 AppWindowContents() {} |
| 62 virtual ~AppWindowContents() {} | 62 virtual ~AppWindowContents() {} |
| 63 | 63 |
| 64 // Called to initialize the WebContents, before the app window is created. | 64 // Called to initialize the WebContents, before the app window is created. |
| 65 virtual void Initialize(content::BrowserContext* context, | 65 virtual void Initialize(content::BrowserContext* context, |
| 66 const GURL& url) = 0; | 66 const GURL& url) = 0; |
| 67 | 67 |
| 68 // Called to load the contents, after the app window is created. | 68 // Called to load the contents, after the app window is created. |
| 69 virtual void LoadContents(int32 creator_process_id) = 0; | 69 virtual void LoadContents(int32 creator_process_id) = 0; |
| 70 | 70 |
| 71 // Called when the native window changes. | 71 // Called when the native window changes. |
| 72 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; | 72 virtual void NativeWindowChanged( |
| 73 extensions::NativeAppWindow* native_app_window) = 0; |
| 73 | 74 |
| 74 // Called when the native window closes. | 75 // Called when the native window closes. |
| 75 virtual void NativeWindowClosed() = 0; | 76 virtual void NativeWindowClosed() = 0; |
| 76 | 77 |
| 77 // Called in tests when the window is shown | 78 // Called in tests when the window is shown |
| 78 virtual void DispatchWindowShownForTests() const = 0; | 79 virtual void DispatchWindowShownForTests() const = 0; |
| 79 | 80 |
| 80 virtual content::WebContents* GetWebContents() const = 0; | 81 virtual content::WebContents* GetWebContents() const = 0; |
| 81 | 82 |
| 82 private: | 83 private: |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 window_type_ == WINDOW_TYPE_V1_PANEL); | 226 window_type_ == WINDOW_TYPE_V1_PANEL); |
| 226 } | 227 } |
| 227 content::BrowserContext* browser_context() const { return browser_context_; } | 228 content::BrowserContext* browser_context() const { return browser_context_; } |
| 228 const gfx::Image& app_icon() const { return app_icon_; } | 229 const gfx::Image& app_icon() const { return app_icon_; } |
| 229 const GURL& app_icon_url() const { return app_icon_url_; } | 230 const GURL& app_icon_url() const { return app_icon_url_; } |
| 230 const gfx::Image& badge_icon() const { return badge_icon_; } | 231 const gfx::Image& badge_icon() const { return badge_icon_; } |
| 231 const GURL& badge_icon_url() const { return badge_icon_url_; } | 232 const GURL& badge_icon_url() const { return badge_icon_url_; } |
| 232 bool is_hidden() const { return is_hidden_; } | 233 bool is_hidden() const { return is_hidden_; } |
| 233 | 234 |
| 234 const extensions::Extension* GetExtension() const; | 235 const extensions::Extension* GetExtension() const; |
| 235 NativeAppWindow* GetBaseWindow(); | 236 extensions::NativeAppWindow* GetBaseWindow(); |
| 236 gfx::NativeWindow GetNativeWindow(); | 237 gfx::NativeWindow GetNativeWindow(); |
| 237 | 238 |
| 238 // Returns the bounds that should be reported to the renderer. | 239 // Returns the bounds that should be reported to the renderer. |
| 239 gfx::Rect GetClientBounds() const; | 240 gfx::Rect GetClientBounds() const; |
| 240 | 241 |
| 241 // NativeAppWindows should call this to determine what the window's title | 242 // NativeAppWindows should call this to determine what the window's title |
| 242 // is on startup and from within UpdateWindowTitle(). | 243 // is on startup and from within UpdateWindowTitle(). |
| 243 base::string16 GetTitle() const; | 244 base::string16 GetTitle() const; |
| 244 | 245 |
| 245 // Call to notify ShellRegistry and delete the window. Subclasses should | 246 // Call to notify ShellRegistry and delete the window. Subclasses should |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 494 |
| 494 // Badge for icon shown in the task bar. | 495 // Badge for icon shown in the task bar. |
| 495 gfx::Image badge_icon_; | 496 gfx::Image badge_icon_; |
| 496 | 497 |
| 497 // URL to be used for setting the badge on the app icon. | 498 // URL to be used for setting the badge on the app icon. |
| 498 GURL badge_icon_url_; | 499 GURL badge_icon_url_; |
| 499 | 500 |
| 500 // An object to load the badge as an extension resource. | 501 // An object to load the badge as an extension resource. |
| 501 scoped_ptr<extensions::IconImage> badge_icon_image_; | 502 scoped_ptr<extensions::IconImage> badge_icon_image_; |
| 502 | 503 |
| 503 scoped_ptr<NativeAppWindow> native_app_window_; | 504 scoped_ptr<extensions::NativeAppWindow> native_app_window_; |
| 504 scoped_ptr<AppWindowContents> app_window_contents_; | 505 scoped_ptr<AppWindowContents> app_window_contents_; |
| 505 scoped_ptr<AppDelegate> app_delegate_; | 506 scoped_ptr<AppDelegate> app_delegate_; |
| 506 scoped_ptr<AppWebContentsHelper> helper_; | 507 scoped_ptr<AppWebContentsHelper> helper_; |
| 507 | 508 |
| 508 // Manages popup windows (bubbles, tab-modals) visible overlapping the | 509 // Manages popup windows (bubbles, tab-modals) visible overlapping the |
| 509 // app window. | 510 // app window. |
| 510 scoped_ptr<web_modal::PopupManager> popup_manager_; | 511 scoped_ptr<web_modal::PopupManager> popup_manager_; |
| 511 | 512 |
| 512 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 513 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 513 | 514 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 548 |
| 548 // Whether |alpha_enabled| was set in the CreateParams. | 549 // Whether |alpha_enabled| was set in the CreateParams. |
| 549 bool requested_alpha_enabled_; | 550 bool requested_alpha_enabled_; |
| 550 | 551 |
| 551 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 552 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 552 }; | 553 }; |
| 553 | 554 |
| 554 } // namespace apps | 555 } // namespace apps |
| 555 | 556 |
| 556 #endif // APPS_APP_WINDOW_H_ | 557 #endif // APPS_APP_WINDOW_H_ |
| OLD | NEW |