| 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/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 // Set whether the window should stay above other windows which are not | 348 // Set whether the window should stay above other windows which are not |
| 349 // configured to be always-on-top. | 349 // configured to be always-on-top. |
| 350 void SetAlwaysOnTop(bool always_on_top); | 350 void SetAlwaysOnTop(bool always_on_top); |
| 351 | 351 |
| 352 // Whether the always-on-top property has been set by the chrome.app.window | 352 // Whether the always-on-top property has been set by the chrome.app.window |
| 353 // API. Note that the actual value of this property in the native app window | 353 // API. Note that the actual value of this property in the native app window |
| 354 // may be false if the bit is silently switched off for security reasons. | 354 // may be false if the bit is silently switched off for security reasons. |
| 355 bool IsAlwaysOnTop() const; | 355 bool IsAlwaysOnTop() const; |
| 356 | 356 |
| 357 // Set whether the window should get even reserved keys (modulo platform |
| 358 // restrictions). |
| 359 void SetInterceptAllKeys(bool want_all_keys); |
| 360 |
| 357 // Retrieve the current state of the app window as a dictionary, to pass to | 361 // Retrieve the current state of the app window as a dictionary, to pass to |
| 358 // the renderer. | 362 // the renderer. |
| 359 void GetSerializedState(base::DictionaryValue* properties) const; | 363 void GetSerializedState(base::DictionaryValue* properties) const; |
| 360 | 364 |
| 361 // Called by the window API when events can be sent to the window for this | 365 // Called by the window API when events can be sent to the window for this |
| 362 // app. | 366 // app. |
| 363 void WindowEventsReady(); | 367 void WindowEventsReady(); |
| 364 | 368 |
| 365 protected: | 369 protected: |
| 366 virtual ~AppWindow(); | 370 virtual ~AppWindow(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 // Set the fullscreen state in the native app window. | 459 // Set the fullscreen state in the native app window. |
| 456 void SetNativeWindowFullscreen(); | 460 void SetNativeWindowFullscreen(); |
| 457 | 461 |
| 458 // Returns true if there is any overlap between the window and the taskbar | 462 // Returns true if there is any overlap between the window and the taskbar |
| 459 // (Windows only). | 463 // (Windows only). |
| 460 bool IntersectsWithTaskbar() const; | 464 bool IntersectsWithTaskbar() const; |
| 461 | 465 |
| 462 // Update the always-on-top bit in the native app window. | 466 // Update the always-on-top bit in the native app window. |
| 463 void UpdateNativeAlwaysOnTop(); | 467 void UpdateNativeAlwaysOnTop(); |
| 464 | 468 |
| 469 // Update the intercept-all-keys bit in the native app window. |
| 470 void UpdateNativeInterceptAllKeys(); |
| 471 |
| 465 // Sends the onWindowShown event to the app if the window has been shown. Only | 472 // Sends the onWindowShown event to the app if the window has been shown. Only |
| 466 // has an effect in tests. | 473 // has an effect in tests. |
| 467 void SendOnWindowShownIfShown(); | 474 void SendOnWindowShownIfShown(); |
| 468 | 475 |
| 469 // web_modal::WebContentsModalDialogManagerDelegate implementation. | 476 // web_modal::WebContentsModalDialogManagerDelegate implementation. |
| 470 virtual web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost() | 477 virtual web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost() |
| 471 OVERRIDE; | 478 OVERRIDE; |
| 472 | 479 |
| 473 // Updates the badge to |image|. Called internally from the image loader | 480 // Updates the badge to |image|. Called internally from the image loader |
| 474 // callback. | 481 // callback. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 // Whether the delayed Show() call was for an active or inactive window. | 558 // Whether the delayed Show() call was for an active or inactive window. |
| 552 ShowType delayed_show_type_; | 559 ShowType delayed_show_type_; |
| 553 | 560 |
| 554 // Cache the desired value of the always-on-top property. When windows enter | 561 // Cache the desired value of the always-on-top property. When windows enter |
| 555 // fullscreen or overlap the Windows taskbar, this property will be | 562 // fullscreen or overlap the Windows taskbar, this property will be |
| 556 // automatically and silently switched off for security reasons. It is | 563 // automatically and silently switched off for security reasons. It is |
| 557 // reinstated when the window exits fullscreen and moves away from the | 564 // reinstated when the window exits fullscreen and moves away from the |
| 558 // taskbar. | 565 // taskbar. |
| 559 bool cached_always_on_top_; | 566 bool cached_always_on_top_; |
| 560 | 567 |
| 568 // Cached value of InterceptAllKeys property that is used to save/restore |
| 569 // state as the window is active/loses focus. |
| 570 bool cached_want_all_keys_; |
| 571 |
| 561 DISALLOW_COPY_AND_ASSIGN(AppWindow); | 572 DISALLOW_COPY_AND_ASSIGN(AppWindow); |
| 562 }; | 573 }; |
| 563 | 574 |
| 564 } // namespace apps | 575 } // namespace apps |
| 565 | 576 |
| 566 #endif // APPS_APP_WINDOW_H_ | 577 #endif // APPS_APP_WINDOW_H_ |
| OLD | NEW |