Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Issue 26427002: Add always-on-top property to app windows (Closed)

Created:
7 years, 2 months ago by tmdiep
Modified:
7 years, 2 months ago
CC:
chromium-reviews, tfarina, ben+watch_chromium.org, extensions-reviews_chromium.org, chromium-apps-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

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. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228160

Patch Set 1 #

Patch Set 2 : Fixed file modes for test files #

Total comments: 6

Patch Set 3 : Rebase #

Patch Set 4 : Cache state of isAlwaysOnTop in widget. Fixed clobber in x11 window init. #

Total comments: 7

Patch Set 5 : Moved SetAlwaysOnTop() from NativeAppWindow to ui::BaseWindow. Addressed review comments. #

Patch Set 6 : Removed potentially flaky test #

Total comments: 8

Patch Set 7 : Addressed review comments #

Patch Set 8 : Fixed ExtensionApiTest.Stubs failure and added setAlwaysOnTop call back into test. #

Patch Set 9 : Merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -25 lines) Patch
M apps/app_window_contents.cc View 1 chunk +1 line, -0 lines 0 comments Download
M apps/shell_window.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M apps/shell_window.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h View 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/app_window/app_window_api.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/app_window/app_window_apitest.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm View 1 2 3 4 5 6 7 8 4 chunks +16 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/apps/native_app_window_gtk.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/apps/native_app_window_gtk.cc View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel.h View 1 2 3 4 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/ui/panels/panel.cc View 1 2 3 4 5 6 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/apps/native_app_window_views.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/apps/native_app_window_views.cc View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/_api_features.json View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/app_current_window_internal.idl View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/app_window.idl View 1 2 3 4 2 chunks +15 lines, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/app_window_custom_bindings.js View 2 chunks +5 lines, -1 line 0 comments Download
M chrome/test/base/test_browser_window.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/platform_apps/windows_api_always_on_top/background.js View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/windows_api_always_on_top/index.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/test/data/extensions/platform_apps/windows_api_always_on_top/manifest.json View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/base/base_window.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_win.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc View 1 2 3 4 chunks +28 lines, -12 lines 0 comments Download
M ui/views/widget/native_widget_aura.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_private.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_win.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.h View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
tmdiep
This is a patch for chrome.app.window alwaysOnTop property. API proposal: https://docs.google.com/document/d/1F54IJ4nDQGU8hWwOOcYopyXXQirBFPjvZih4zOyfKgY/edit?usp=sharing Would you mind reviewing ...
7 years, 2 months ago (2013-10-08 05:04:58 UTC) #1
sky
https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc#newcode662 ui/views/widget/widget.cc:662: return native_widget_->IsAlwaysOnTop(); Can we make widget cache the value ...
7 years, 2 months ago (2013-10-08 15:46:09 UTC) #2
Elliot Glaysher
https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc File ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc (right): https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc#newcode928 ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc:928: XChangeProperty (xdisplay_, This will clobber the XChangeProperty immediately above. ...
7 years, 2 months ago (2013-10-08 18:05:00 UTC) #3
benwells
https://codereview.chromium.org/26427002/diff/27001/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc File chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc (right): https://codereview.chromium.org/26427002/diff/27001/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc#newcode209 chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc:209: if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV) { Can we use _api_features.json ...
7 years, 2 months ago (2013-10-09 02:00:49 UTC) #4
tmdiep
Thanks Elliot and Sky. Review comments addressed in patch 4. https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc File ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc (right): https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc#newcode928 ...
7 years, 2 months ago (2013-10-09 02:15:04 UTC) #5
tmdiep
Thanks Ben. Patch 5 addresses review comments. As discussed, SetAlwaysOnTop() was moved from NativeAppWindow to ...
7 years, 2 months ago (2013-10-09 06:18:07 UTC) #6
sky
https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc#newcode662 ui/views/widget/widget.cc:662: return native_widget_->IsAlwaysOnTop(); On 2013/10/09 02:15:04, tmdiep wrote: > On ...
7 years, 2 months ago (2013-10-09 13:23:37 UTC) #7
tmdiep
https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc File ui/views/widget/widget.cc (right): https://codereview.chromium.org/26427002/diff/3001/ui/views/widget/widget.cc#newcode662 ui/views/widget/widget.cc:662: return native_widget_->IsAlwaysOnTop(); On 2013/10/09 13:23:38, sky wrote: > Yes. ...
7 years, 2 months ago (2013-10-10 02:35:08 UTC) #8
sky
Ok, go with the implementation that always queries the native widget. https://codereview.chromium.org/26427002/diff/57001/ui/views/widget/widget.h File ui/views/widget/widget.h (right): ...
7 years, 2 months ago (2013-10-10 02:45:57 UTC) #9
sky
Couple more https://codereview.chromium.org/26427002/diff/57001/chrome/browser/ui/panels/panel.h File chrome/browser/ui/panels/panel.h (left): https://codereview.chromium.org/26427002/diff/57001/chrome/browser/ui/panels/panel.h#oldcode249 chrome/browser/ui/panels/panel.h:249: void SetAlwaysOnTop(bool on_top); move implementation to match ...
7 years, 2 months ago (2013-10-10 02:47:51 UTC) #10
tmdiep
https://codereview.chromium.org/26427002/diff/57001/chrome/browser/ui/panels/panel.h File chrome/browser/ui/panels/panel.h (left): https://codereview.chromium.org/26427002/diff/57001/chrome/browser/ui/panels/panel.h#oldcode249 chrome/browser/ui/panels/panel.h:249: void SetAlwaysOnTop(bool on_top); On 2013/10/10 02:47:52, sky wrote: > ...
7 years, 2 months ago (2013-10-10 04:02:00 UTC) #11
sky
LGTM
7 years, 2 months ago (2013-10-10 16:00:31 UTC) #12
Elliot Glaysher
lgtm
7 years, 2 months ago (2013-10-10 17:59:40 UTC) #13
benwells
lgtm
7 years, 2 months ago (2013-10-11 03:07:06 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tmdiep@chromium.org/26427002/87001
7 years, 2 months ago (2013-10-11 04:40:39 UTC) #15
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/extension_function_histogram_value.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 2 months ago (2013-10-11 04:40:48 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tmdiep@chromium.org/26427002/105001
7 years, 2 months ago (2013-10-11 04:51:48 UTC) #17
commit-bot: I haz the power
7 years, 2 months ago (2013-10-11 11:27:27 UTC) #18
Message was sent while issue was closed.
Change committed as 228160

Powered by Google App Engine
This is Rietveld 408576698