| 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 <memory> | 10 #include <memory> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Called to load the contents, after the app window is created. | 65 // Called to load the contents, after the app window is created. |
| 66 virtual void LoadContents(int32_t creator_process_id) = 0; | 66 virtual void LoadContents(int32_t creator_process_id) = 0; |
| 67 | 67 |
| 68 // Called when the native window changes. | 68 // Called when the native window changes. |
| 69 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; | 69 virtual void NativeWindowChanged(NativeAppWindow* native_app_window) = 0; |
| 70 | 70 |
| 71 // Called when the native window closes. | 71 // Called when the native window closes. |
| 72 virtual void NativeWindowClosed() = 0; | 72 virtual void NativeWindowClosed() = 0; |
| 73 | 73 |
| 74 // Called in tests when the window is shown | |
| 75 virtual void DispatchWindowShownForTests() const = 0; | |
| 76 | |
| 77 // Called when the renderer notifies the browser that the window is ready. | 74 // Called when the renderer notifies the browser that the window is ready. |
| 78 virtual void OnWindowReady() = 0; | 75 virtual void OnWindowReady() = 0; |
| 79 | 76 |
| 80 virtual content::WebContents* GetWebContents() const = 0; | 77 virtual content::WebContents* GetWebContents() const = 0; |
| 81 | 78 |
| 82 virtual extensions::WindowController* GetWindowController() const = 0; | 79 virtual extensions::WindowController* GetWindowController() const = 0; |
| 83 | 80 |
| 84 private: | 81 private: |
| 85 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); | 82 DISALLOW_COPY_AND_ASSIGN(AppWindowContents); |
| 86 }; | 83 }; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // may be false if the bit is silently switched off for security reasons. | 349 // may be false if the bit is silently switched off for security reasons. |
| 353 bool IsAlwaysOnTop() const; | 350 bool IsAlwaysOnTop() const; |
| 354 | 351 |
| 355 // Restores the always-on-top property according to |cached_always_on_top_|. | 352 // Restores the always-on-top property according to |cached_always_on_top_|. |
| 356 void RestoreAlwaysOnTop(); | 353 void RestoreAlwaysOnTop(); |
| 357 | 354 |
| 358 // Retrieve the current state of the app window as a dictionary, to pass to | 355 // Retrieve the current state of the app window as a dictionary, to pass to |
| 359 // the renderer. | 356 // the renderer. |
| 360 void GetSerializedState(base::DictionaryValue* properties) const; | 357 void GetSerializedState(base::DictionaryValue* properties) const; |
| 361 | 358 |
| 362 // Called by the window API when events can be sent to the window for this | |
| 363 // app. | |
| 364 void WindowEventsReady(); | |
| 365 | |
| 366 // Notifies the window's contents that the render view is ready and it can | 359 // Notifies the window's contents that the render view is ready and it can |
| 367 // unblock resource requests. | 360 // unblock resource requests. |
| 368 void NotifyRenderViewReady(); | 361 void NotifyRenderViewReady(); |
| 369 | 362 |
| 370 // Whether the app window wants to be alpha enabled. | 363 // Whether the app window wants to be alpha enabled. |
| 371 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } | 364 bool requested_alpha_enabled() const { return requested_alpha_enabled_; } |
| 372 | 365 |
| 373 // Whether the app window is created by IME extensions. | 366 // Whether the app window is created by IME extensions. |
| 374 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used | 367 // TODO(bshe): rename to hide_app_window_in_launcher if it is not used |
| 375 // anywhere other than app_window_launcher_controller after M45. Otherwise, | 368 // anywhere other than app_window_launcher_controller after M45. Otherwise, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 bool user_gesture, | 432 bool user_gesture, |
| 440 bool last_unlocked_by_target) override; | 433 bool last_unlocked_by_target) override; |
| 441 bool PreHandleGestureEvent(content::WebContents* source, | 434 bool PreHandleGestureEvent(content::WebContents* source, |
| 442 const blink::WebGestureEvent& event) override; | 435 const blink::WebGestureEvent& event) override; |
| 443 std::unique_ptr<content::BluetoothChooser> RunBluetoothChooser( | 436 std::unique_ptr<content::BluetoothChooser> RunBluetoothChooser( |
| 444 content::RenderFrameHost* frame, | 437 content::RenderFrameHost* frame, |
| 445 const content::BluetoothChooser::EventHandler& event_handler) override; | 438 const content::BluetoothChooser::EventHandler& event_handler) override; |
| 446 | 439 |
| 447 // content::WebContentsObserver implementation. | 440 // content::WebContentsObserver implementation. |
| 448 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 441 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
| 449 void DidFirstVisuallyNonEmptyPaint() override; | |
| 450 | 442 |
| 451 // ExtensionFunctionDispatcher::Delegate implementation. | 443 // ExtensionFunctionDispatcher::Delegate implementation. |
| 452 WindowController* GetExtensionWindowController() const override; | 444 WindowController* GetExtensionWindowController() const override; |
| 453 content::WebContents* GetAssociatedWebContents() const override; | 445 content::WebContents* GetAssociatedWebContents() const override; |
| 454 | 446 |
| 455 // ExtensionRegistryObserver implementation. | 447 // ExtensionRegistryObserver implementation. |
| 456 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 448 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 457 const Extension* extension, | 449 const Extension* extension, |
| 458 UnloadedExtensionInfo::Reason reason) override; | 450 UnloadedExtensionInfo::Reason reason) override; |
| 459 | 451 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 std::unique_ptr<AppWindowContents> app_window_contents_; | 530 std::unique_ptr<AppWindowContents> app_window_contents_; |
| 539 std::unique_ptr<AppDelegate> app_delegate_; | 531 std::unique_ptr<AppDelegate> app_delegate_; |
| 540 std::unique_ptr<AppWebContentsHelper> helper_; | 532 std::unique_ptr<AppWebContentsHelper> helper_; |
| 541 | 533 |
| 542 // The initial url this AppWindow was navigated to. | 534 // The initial url this AppWindow was navigated to. |
| 543 GURL initial_url_; | 535 GURL initial_url_; |
| 544 | 536 |
| 545 // Bit field of FullscreenType. | 537 // Bit field of FullscreenType. |
| 546 int fullscreen_types_; | 538 int fullscreen_types_; |
| 547 | 539 |
| 548 // Show has been called, so the window should be shown once the first visually | |
| 549 // non-empty paint occurs. | |
| 550 bool show_on_first_paint_; | |
| 551 | |
| 552 // The first visually non-empty paint has completed. | |
| 553 bool first_paint_complete_; | |
| 554 | |
| 555 // Whether the window has been shown or not. | 540 // Whether the window has been shown or not. |
| 556 bool has_been_shown_; | 541 bool has_been_shown_; |
| 557 | 542 |
| 558 // Whether events can be sent to the window. | |
| 559 bool can_send_events_; | |
| 560 | |
| 561 // Whether the window is hidden or not. Hidden in this context means actively | 543 // Whether the window is hidden or not. Hidden in this context means actively |
| 562 // by the chrome.app.window API, not in an operating system context. For | 544 // by the chrome.app.window API, not in an operating system context. For |
| 563 // example windows which are minimized are not hidden, and windows which are | 545 // example windows which are minimized are not hidden, and windows which are |
| 564 // part of a hidden app on OS X are not hidden. Windows which were created | 546 // part of a hidden app on OS X are not hidden. Windows which were created |
| 565 // with the |hidden| flag set to true, or which have been programmatically | 547 // with the |hidden| flag set to true, or which have been programmatically |
| 566 // hidden, are considered hidden. | 548 // hidden, are considered hidden. |
| 567 bool is_hidden_; | 549 bool is_hidden_; |
| 568 | 550 |
| 569 // Whether the delayed Show() call was for an active or inactive window. | |
| 570 ShowType delayed_show_type_; | |
| 571 | |
| 572 // Cache the desired value of the always-on-top property. When windows enter | 551 // Cache the desired value of the always-on-top property. When windows enter |
| 573 // fullscreen or overlap the Windows taskbar, this property will be | 552 // fullscreen or overlap the Windows taskbar, this property will be |
| 574 // automatically and silently switched off for security reasons. It is | 553 // automatically and silently switched off for security reasons. It is |
| 575 // reinstated when the window exits fullscreen and moves away from the | 554 // reinstated when the window exits fullscreen and moves away from the |
| 576 // taskbar. | 555 // taskbar. |
| 577 bool cached_always_on_top_; | 556 bool cached_always_on_top_; |
| 578 | 557 |
| 579 // Whether |alpha_enabled| was set in the CreateParams. | 558 // Whether |alpha_enabled| was set in the CreateParams. |
| 580 bool requested_alpha_enabled_; | 559 bool requested_alpha_enabled_; |
| 581 | 560 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 594 base::Closure on_first_commit_callback_; | 573 base::Closure on_first_commit_callback_; |
| 595 | 574 |
| 596 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; | 575 base::WeakPtrFactory<AppWindow> image_loader_ptr_factory_; |
| 597 | 576 |
| 598 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 577 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 599 }; | 578 }; |
| 600 | 579 |
| 601 } // namespace extensions | 580 } // namespace extensions |
| 602 | 581 |
| 603 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ | 582 #endif // EXTENSIONS_BROWSER_APP_WINDOW_APP_WINDOW_H_ |
| OLD | NEW |