diff options
author | tmdiep@chromium.org <tmdiep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-11 11:27:22 +0000 |
---|---|---|
committer | tmdiep@chromium.org <tmdiep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-11 11:27:22 +0000 |
commit | 46d46055fa8fb752bcab72ed1476e81924f5a74d (patch) | |
tree | ba758f30c65170ebc42f220b5f5810addcd03c26 /chrome/browser/ui/panels | |
parent | 8321c5fa5df8d43f01937c2d7f00dafe1486b510 (diff) | |
download | chromium_src-46d46055fa8fb752bcab72ed1476e81924f5a74d.zip chromium_src-46d46055fa8fb752bcab72ed1476e81924f5a74d.tar.gz chromium_src-46d46055fa8fb752bcab72ed1476e81924f5a74d.tar.bz2 |
Add always-on-top property to app windows
The chrome.app.window API has been extended to include:
- A new alwaysOnTop option for the create() function.
- An AppWindow.isAlwaysOnTop() function to query the state of this
property.
- An AppWindow.setAlwaysOnTop() function to change this property after
creation of the window.
Changes involving native app windows:
- Added apps::NativeAppWindow::SetAlwaysOnTop().
- Implemented IsAlwaysOnTop(), a function inherited from ui::BaseWindow
but was left unimplemented for native app windows.
Changes involving views:
- Added IsAlwaysOnTop(). SetAlwaysOnTop() already existed.
BUG=171597
TEST=browser_tests (PlatformAppBrowserTest.WindowsApiAlwaysOnTop).
Test manually by creating an app that enables the alwaysOnTop option
on window creation and changes the property after creation.
Test Windows, Mac, ChromeOS and Linux.
Review URL: https://codereview.chromium.org/26427002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/panels')
-rw-r--r-- | chrome/browser/ui/panels/panel.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/panels/panel.h | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc index 2b21bc7..bef02b1 100644 --- a/chrome/browser/ui/panels/panel.cc +++ b/chrome/browser/ui/panels/panel.cc @@ -350,6 +350,10 @@ bool Panel::IsAlwaysOnTop() const { return native_panel_->IsPanelAlwaysOnTop(); } +void Panel::SetAlwaysOnTop(bool on_top) { + native_panel_->SetPanelAlwaysOnTop(on_top); +} + void Panel::ExecuteCommandWithDisposition(int id, WindowOpenDisposition disposition) { DCHECK(command_updater_.IsCommandEnabled(id)) << "Invalid/disabled command " @@ -658,10 +662,6 @@ void Panel::HandleKeyboardEvent(const content::NativeWebKeyboardEvent& event) { native_panel_->HandlePanelKeyboardEvent(event); } -void Panel::SetAlwaysOnTop(bool on_top) { - native_panel_->SetPanelAlwaysOnTop(on_top); -} - void Panel::SetPreviewMode(bool in_preview) { DCHECK_NE(in_preview_mode_, in_preview); in_preview_mode_ = in_preview; diff --git a/chrome/browser/ui/panels/panel.h b/chrome/browser/ui/panels/panel.h index 8ce650b..3e5bde5 100644 --- a/chrome/browser/ui/panels/panel.h +++ b/chrome/browser/ui/panels/panel.h @@ -133,6 +133,7 @@ class Panel : public ui::BaseWindow, virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; virtual void FlashFrame(bool flash) OVERRIDE; virtual bool IsAlwaysOnTop() const OVERRIDE; + virtual void SetAlwaysOnTop(bool on_top) OVERRIDE; // Overridden from CommandUpdaterDelegate: virtual void ExecuteCommandWithDisposition( @@ -245,9 +246,6 @@ class Panel : public ui::BaseWindow, // Handles keyboard events coming back from the renderer. void HandleKeyboardEvent(const content::NativeWebKeyboardEvent& event); - // Whether the panel window is always on top. - void SetAlwaysOnTop(bool on_top); - // Sets whether the panel is shown in preview mode. When the panel is // being dragged, it is in preview mode. void SetPreviewMode(bool in_preview_mode); |