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 "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" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // Called to load the contents, after the app window is created. | 63 // Called to load the contents, after the app window is created. |
64 virtual void LoadContents(int32 creator_process_id) = 0; | 64 virtual void LoadContents(int32 creator_process_id) = 0; |
65 | 65 |
66 // Called when the native window changes. | 66 // Called when the native window changes. |
67 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; | 67 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; |
68 | 68 |
69 // Called when the native window closes. | 69 // Called when the native window closes. |
70 virtual void NativeWindowClosed() = 0; | 70 virtual void NativeWindowClosed() = 0; |
71 | 71 |
| 72 // Called with the native window is first shown. |
| 73 virtual void NativeWindowFirstShown() const = 0; |
| 74 |
72 virtual content::WebContents* GetWebContents() const = 0; | 75 virtual content::WebContents* GetWebContents() const = 0; |
73 | 76 |
74 private: | 77 private: |
75 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); | 78 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); |
76 }; | 79 }; |
77 | 80 |
78 // AppWindow is the type of window used by platform apps. App windows | 81 // AppWindow is the type of window used by platform apps. App windows |
79 // have a WebContents but none of the chrome of normal browser windows. | 82 // have a WebContents but none of the chrome of normal browser windows. |
80 class AppWindow : public content::NotificationObserver, | 83 class AppWindow : public content::NotificationObserver, |
81 public content::WebContentsDelegate, | 84 public content::WebContentsDelegate, |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 // Bit field of FullscreenType. | 519 // Bit field of FullscreenType. |
517 int fullscreen_types_; | 520 int fullscreen_types_; |
518 | 521 |
519 // Show has been called, so the window should be shown once the first visually | 522 // Show has been called, so the window should be shown once the first visually |
520 // non-empty paint occurs. | 523 // non-empty paint occurs. |
521 bool show_on_first_paint_; | 524 bool show_on_first_paint_; |
522 | 525 |
523 // The first visually non-empty paint has completed. | 526 // The first visually non-empty paint has completed. |
524 bool first_paint_complete_; | 527 bool first_paint_complete_; |
525 | 528 |
| 529 // The window has been shown. |
| 530 bool has_been_shown_; |
| 531 |
526 // Whether the window is hidden or not. Hidden in this context means actively | 532 // Whether the window is hidden or not. Hidden in this context means actively |
527 // by the chrome.app.window API, not in an operating system context. For | 533 // by the chrome.app.window API, not in an operating system context. For |
528 // example windows which are minimized are not hidden, and windows which are | 534 // example windows which are minimized are not hidden, and windows which are |
529 // part of a hidden app on OS X are not hidden. Windows which were created | 535 // part of a hidden app on OS X are not hidden. Windows which were created |
530 // with the |hidden| flag set to true, or which have been programmatically | 536 // with the |hidden| flag set to true, or which have been programmatically |
531 // hidden, are considered hidden. | 537 // hidden, are considered hidden. |
532 bool is_hidden_; | 538 bool is_hidden_; |
533 | 539 |
534 // Whether the delayed Show() call was for an active or inactive window. | 540 // Whether the delayed Show() call was for an active or inactive window. |
535 ShowType delayed_show_type_; | 541 ShowType delayed_show_type_; |
536 | 542 |
537 // Cache the desired value of the always-on-top property. When windows enter | 543 // Cache the desired value of the always-on-top property. When windows enter |
538 // fullscreen or overlap the Windows taskbar, this property will be | 544 // fullscreen or overlap the Windows taskbar, this property will be |
539 // automatically and silently switched off for security reasons. It is | 545 // automatically and silently switched off for security reasons. It is |
540 // reinstated when the window exits fullscreen and moves away from the | 546 // reinstated when the window exits fullscreen and moves away from the |
541 // taskbar. | 547 // taskbar. |
542 bool cached_always_on_top_; | 548 bool cached_always_on_top_; |
543 | 549 |
544 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 550 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
545 }; | 551 }; |
546 | 552 |
547 } // namespace apps | 553 } // namespace apps |
548 | 554 |
549 #endif // APPS_APP_WINDOW_H_ | 555 #endif // APPS_APP_WINDOW_H_ |
OLD | NEW |