| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 // The API enables developers to specify content or window size constraints. | 190 // The API enables developers to specify content or window size constraints. |
| 191 // These functions combine them so that we can work with one set of | 191 // These functions combine them so that we can work with one set of |
| 192 // constraints. | 192 // constraints. |
| 193 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; | 193 gfx::Size GetContentMinimumSize(const gfx::Insets& frame_insets) const; |
| 194 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; | 194 gfx::Size GetContentMaximumSize(const gfx::Insets& frame_insets) const; |
| 195 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; | 195 gfx::Size GetWindowMinimumSize(const gfx::Insets& frame_insets) const; |
| 196 gfx::Size GetWindowMaximumSize(const gfx::Insets& frame_insets) const; | 196 gfx::Size GetWindowMaximumSize(const gfx::Insets& frame_insets) const; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 class Delegate { | |
| 200 public: | |
| 201 virtual ~Delegate(); | |
| 202 | |
| 203 virtual NativeAppWindow* CreateNativeAppWindow( | |
| 204 AppWindow* window, | |
| 205 const CreateParams& params) = 0; | |
| 206 }; | |
| 207 | |
| 208 // Convert draggable regions in raw format to SkRegion format. Caller is | 199 // Convert draggable regions in raw format to SkRegion format. Caller is |
| 209 // responsible for deleting the returned SkRegion instance. | 200 // responsible for deleting the returned SkRegion instance. |
| 210 static SkRegion* RawDraggableRegionsToSkRegion( | 201 static SkRegion* RawDraggableRegionsToSkRegion( |
| 211 const std::vector<extensions::DraggableRegion>& regions); | 202 const std::vector<extensions::DraggableRegion>& regions); |
| 212 | 203 |
| 213 // The constructor and Init methods are public for constructing a AppWindow | 204 // The constructor and Init methods are public for constructing a AppWindow |
| 214 // with a non-standard render interface (e.g. v1 apps using Ash Panels). | 205 // with a non-standard render interface (e.g. v1 apps using Ash Panels). |
| 215 // Normally AppWindow::Create should be used. | 206 // Normally AppWindow::Create should be used. |
| 216 // Takes ownership of |app_delegate| and |delegate|. | 207 // Takes ownership of |app_delegate| and |delegate|. |
| 217 AppWindow(content::BrowserContext* context, | 208 AppWindow(content::BrowserContext* context, |
| 218 AppDelegate* app_delegate, | 209 AppDelegate* app_delegate, |
| 219 Delegate* delegate, | |
| 220 const extensions::Extension* extension); | 210 const extensions::Extension* extension); |
| 221 | 211 |
| 222 // Initializes the render interface, web contents, and native window. | 212 // Initializes the render interface, web contents, and native window. |
| 223 // |app_window_contents| will become owned by AppWindow. | 213 // |app_window_contents| will become owned by AppWindow. |
| 224 void Init(const GURL& url, | 214 void Init(const GURL& url, |
| 225 AppWindowContents* app_window_contents, | 215 AppWindowContents* app_window_contents, |
| 226 const CreateParams& params); | 216 const CreateParams& params); |
| 227 | 217 |
| 228 const std::string& window_key() const { return window_key_; } | 218 const std::string& window_key() const { return window_key_; } |
| 229 const SessionID& session_id() const { return session_id_; } | 219 const SessionID& session_id() const { return session_id_; } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 497 |
| 508 // 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. |
| 509 GURL badge_icon_url_; | 499 GURL badge_icon_url_; |
| 510 | 500 |
| 511 // An object to load the badge as an extension resource. | 501 // An object to load the badge as an extension resource. |
| 512 scoped_ptr<extensions::IconImage> badge_icon_image_; | 502 scoped_ptr<extensions::IconImage> badge_icon_image_; |
| 513 | 503 |
| 514 scoped_ptr<NativeAppWindow> native_app_window_; | 504 scoped_ptr<NativeAppWindow> native_app_window_; |
| 515 scoped_ptr<AppWindowContents> app_window_contents_; | 505 scoped_ptr<AppWindowContents> app_window_contents_; |
| 516 scoped_ptr<AppDelegate> app_delegate_; | 506 scoped_ptr<AppDelegate> app_delegate_; |
| 517 scoped_ptr<Delegate> delegate_; | |
| 518 scoped_ptr<AppWebContentsHelper> helper_; | 507 scoped_ptr<AppWebContentsHelper> helper_; |
| 519 | 508 |
| 520 // Manages popup windows (bubbles, tab-modals) visible overlapping the | 509 // Manages popup windows (bubbles, tab-modals) visible overlapping the |
| 521 // app window. | 510 // app window. |
| 522 scoped_ptr<web_modal::PopupManager> popup_manager_; | 511 scoped_ptr<web_modal::PopupManager> popup_manager_; |
| 523 | 512 |
| 524 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 513 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 525 | 514 |
| 526 // Bit field of FullscreenType. | 515 // Bit field of FullscreenType. |
| 527 int fullscreen_types_; | 516 int fullscreen_types_; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 548 |
| 560 // Whether |transparent_background| was set in the CreateParams. | 549 // Whether |transparent_background| was set in the CreateParams. |
| 561 bool requested_transparent_background_; | 550 bool requested_transparent_background_; |
| 562 | 551 |
| 563 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 552 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 564 }; | 553 }; |
| 565 | 554 |
| 566 } // namespace apps | 555 } // namespace apps |
| 567 | 556 |
| 568 #endif // APPS_APP_WINDOW_H_ | 557 #endif // APPS_APP_WINDOW_H_ |
| OLD | NEW |