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 /apps | |
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 'apps')
-rw-r--r-- | apps/app_window_contents.cc | 1 | ||||
-rw-r--r-- | apps/shell_window.cc | 3 | ||||
-rw-r--r-- | apps/shell_window.h | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_window_contents.cc b/apps/app_window_contents.cc index 56ae403..ccafd05 100644 --- a/apps/app_window_contents.cc +++ b/apps/app_window_contents.cc @@ -92,6 +92,7 @@ void AppWindowContents::NativeWindowChanged( native_app_window->IsFullscreenOrPending()); dictionary->SetBoolean("minimized", native_app_window->IsMinimized()); dictionary->SetBoolean("maximized", native_app_window->IsMaximized()); + dictionary->SetBoolean("alwaysOnTop", native_app_window->IsAlwaysOnTop()); content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); rvh->Send(new ExtensionMsg_MessageInvoke(rvh->GetRoutingID(), diff --git a/apps/shell_window.cc b/apps/shell_window.cc index 691bff8..e722f4a 100644 --- a/apps/shell_window.cc +++ b/apps/shell_window.cc @@ -65,7 +65,8 @@ ShellWindow::CreateParams::CreateParams() state(ui::SHOW_STATE_DEFAULT), hidden(false), resizable(true), - focused(true) {} + focused(true), + always_on_top(false) {} ShellWindow::CreateParams::~CreateParams() {} diff --git a/apps/shell_window.h b/apps/shell_window.h index 3d42da7..aee0cc5 100644 --- a/apps/shell_window.h +++ b/apps/shell_window.h @@ -123,6 +123,10 @@ class ShellWindow : public content::NotificationObserver, // If true, the window will be focused on creation. Defaults to true. bool focused; + + // If true, the window will stay on top of other windows that are not + // configured to be always on top. Defaults to false. + bool always_on_top; }; class Delegate { |