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 17 matching lines...) Expand all Loading... |
28 namespace base { | 28 namespace base { |
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 AppDelegate; |
| 39 class AppWebContentsHelper; |
38 class Extension; | 40 class Extension; |
39 class NativeAppWindow; | 41 class NativeAppWindow; |
40 class PlatformAppBrowserTest; | 42 class PlatformAppBrowserTest; |
41 class WindowController; | 43 class WindowController; |
42 | 44 |
43 struct DraggableRegion; | 45 struct DraggableRegion; |
44 } | 46 } |
45 | 47 |
46 namespace ui { | 48 namespace ui { |
47 class BaseWindow; | 49 class BaseWindow; |
48 } | 50 } |
49 | 51 |
50 namespace apps { | 52 namespace apps { |
51 | 53 |
52 class AppDelegate; | |
53 class AppWebContentsHelper; | |
54 | |
55 // Manages the web contents for app windows. The implementation for this | 54 // Manages the web contents for app windows. The implementation for this |
56 // class should create and maintain the WebContents for the window, and handle | 55 // 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 | 56 // any message passing between the web contents and the extension system or |
58 // native window. | 57 // native window. |
59 class AppWindowContents { | 58 class AppWindowContents { |
60 public: | 59 public: |
61 AppWindowContents() {} | 60 AppWindowContents() {} |
62 virtual ~AppWindowContents() {} | 61 virtual ~AppWindowContents() {} |
63 | 62 |
64 // Called to initialize the WebContents, before the app window is created. | 63 // Called to initialize the WebContents, before the app window is created. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Convert draggable regions in raw format to SkRegion format. Caller is | 199 // Convert draggable regions in raw format to SkRegion format. Caller is |
201 // responsible for deleting the returned SkRegion instance. | 200 // responsible for deleting the returned SkRegion instance. |
202 static SkRegion* RawDraggableRegionsToSkRegion( | 201 static SkRegion* RawDraggableRegionsToSkRegion( |
203 const std::vector<extensions::DraggableRegion>& regions); | 202 const std::vector<extensions::DraggableRegion>& regions); |
204 | 203 |
205 // The constructor and Init methods are public for constructing a AppWindow | 204 // The constructor and Init methods are public for constructing a AppWindow |
206 // 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). |
207 // Normally AppWindow::Create should be used. | 206 // Normally AppWindow::Create should be used. |
208 // Takes ownership of |app_delegate| and |delegate|. | 207 // Takes ownership of |app_delegate| and |delegate|. |
209 AppWindow(content::BrowserContext* context, | 208 AppWindow(content::BrowserContext* context, |
210 AppDelegate* app_delegate, | 209 extensions::AppDelegate* app_delegate, |
211 const extensions::Extension* extension); | 210 const extensions::Extension* extension); |
212 | 211 |
213 // Initializes the render interface, web contents, and native window. | 212 // Initializes the render interface, web contents, and native window. |
214 // |app_window_contents| will become owned by AppWindow. | 213 // |app_window_contents| will become owned by AppWindow. |
215 void Init(const GURL& url, | 214 void Init(const GURL& url, |
216 AppWindowContents* app_window_contents, | 215 AppWindowContents* app_window_contents, |
217 const CreateParams& params); | 216 const CreateParams& params); |
218 | 217 |
219 const std::string& window_key() const { return window_key_; } | 218 const std::string& window_key() const { return window_key_; } |
220 const SessionID& session_id() const { return session_id_; } | 219 const SessionID& session_id() const { return session_id_; } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 gfx::Image badge_icon_; | 495 gfx::Image badge_icon_; |
497 | 496 |
498 // URL to be used for setting the badge on the app icon. | 497 // URL to be used for setting the badge on the app icon. |
499 GURL badge_icon_url_; | 498 GURL badge_icon_url_; |
500 | 499 |
501 // An object to load the badge as an extension resource. | 500 // An object to load the badge as an extension resource. |
502 scoped_ptr<extensions::IconImage> badge_icon_image_; | 501 scoped_ptr<extensions::IconImage> badge_icon_image_; |
503 | 502 |
504 scoped_ptr<extensions::NativeAppWindow> native_app_window_; | 503 scoped_ptr<extensions::NativeAppWindow> native_app_window_; |
505 scoped_ptr<AppWindowContents> app_window_contents_; | 504 scoped_ptr<AppWindowContents> app_window_contents_; |
506 scoped_ptr<AppDelegate> app_delegate_; | 505 scoped_ptr<extensions::AppDelegate> app_delegate_; |
507 scoped_ptr<AppWebContentsHelper> helper_; | 506 scoped_ptr<extensions::AppWebContentsHelper> helper_; |
508 | 507 |
509 // Manages popup windows (bubbles, tab-modals) visible overlapping the | 508 // Manages popup windows (bubbles, tab-modals) visible overlapping the |
510 // app window. | 509 // app window. |
511 scoped_ptr<web_modal::PopupManager> popup_manager_; | 510 scoped_ptr<web_modal::PopupManager> popup_manager_; |
512 | 511 |
513 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 512 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
514 | 513 |
515 // Bit field of FullscreenType. | 514 // Bit field of FullscreenType. |
516 int fullscreen_types_; | 515 int fullscreen_types_; |
517 | 516 |
(...skipping 30 matching lines...) Expand all Loading... |
548 | 547 |
549 // Whether |alpha_enabled| was set in the CreateParams. | 548 // Whether |alpha_enabled| was set in the CreateParams. |
550 bool requested_alpha_enabled_; | 549 bool requested_alpha_enabled_; |
551 | 550 |
552 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 551 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
553 }; | 552 }; |
554 | 553 |
555 } // namespace apps | 554 } // namespace apps |
556 | 555 |
557 #endif // APPS_APP_WINDOW_H_ | 556 #endif // APPS_APP_WINDOW_H_ |
OLD | NEW |