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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)

Created:
3 years, 7 months ago by khmel
Modified:
3 years, 6 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org, James Cook, kalyank, sadrul, sky, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Handle app custom icon via aura::Window property. This does refactoring of custom icon functionality for Chrome extension app and for ARC app by unifying applying a custom icon. Before each app class has own logic in window controller that applies the custom icon for the shelf item. With this new CL custom icon is merged to concept of window app icon property which is set by widget delegate. Base AppWindowLauncherController observes changes of native window related to app icon and applies the new window app icon as shelf icon. This CL also moves loading of Chrome App icon from extensions sub-project to chrome/browser (AppWindow->ChromeNativeAppWindowViews). ChromeNativeAppWindowViews is only one consumer of loaded App icon. From other side, chrome/browser has reach functionality to handle Chrome app icons, including ChromeAppIcon. With this CL ExtensionAppLauncher is de-facto deprecated in ChromeLauncherController (to be removed in next CLs). BUG=724292 TEST=Tests + Manually on device, including test apps to validate custom icons for Extension and ARC based apps. Review-Url: https://codereview.chromium.org/2900783003 Cr-Commit-Position: refs/heads/master@{#476761} Committed: https://chromium.googlesource.com/chromium/src/+/1ddcada88969fcf84e51511060588094ddbd54c8

Patch Set 1 #

Patch Set 2 : cleanup #

Total comments: 29

Patch Set 3 : nit #

Total comments: 10

Patch Set 4 : more comments #

Total comments: 2

Patch Set 5 : remove OnAppWindowIconChanged, refactor browser tests #

Patch Set 6 : forgot to add test_app_window_observer.* #

Total comments: 10

Patch Set 7 : nits rebase #

Total comments: 36

Patch Set 8 : nits, discard owner from _item_controller, make SetAppIcon non-static #

Total comments: 5

Patch Set 9 : nits #

Total comments: 8

Patch Set 10 : rebase + comments update #

Patch Set 11 : support unit_tests #

Patch Set 12 : fix mac compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+434 lines, -347 lines) Patch
M chrome/browser/extensions/chrome_app_icon.cc View 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/apps/chrome_app_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/apps/chrome_app_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc View 1 2 3 4 5 6 7 5 chunks +27 lines, -3 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window.h View 1 2 3 4 5 6 7 4 chunks +5 lines, -7 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +16 lines, -13 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.h View 1 2 3 4 5 6 7 2 chunks +1 line, -9 lines 0 comments Download
M chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -24 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc View 1 2 3 4 5 6 7 8 9 4 chunks +18 lines, -10 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +52 lines, -40 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -25 lines 0 comments Download
M chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -2 lines 0 comments Download
A chrome/browser/ui/test/test_app_window_icon_observer.h View 1 2 3 4 5 6 7 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/browser/ui/test/test_app_window_icon_observer.cc View 1 2 3 4 5 6 7 1 chunk +61 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/apps/chrome_native_app_window_views.h View 1 2 3 4 5 6 7 3 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/ui/views/apps/chrome_native_app_window_views.cc View 1 2 3 4 5 6 7 8 9 3 chunks +56 lines, -5 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -1 line 0 comments Download
M chrome/test/data/extensions/platform_apps/app_icon/test.js View 1 2 3 4 5 6 1 chunk +45 lines, -20 lines 0 comments Download
M components/exo/shell_surface.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -1 line 0 comments Download
M components/exo/shell_surface.cc View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -0 lines 0 comments Download
M extensions/browser/api/app_window/app_window_apitest.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -40 lines 0 comments Download
M extensions/browser/app_window/app_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/app_window/app_window.h View 1 2 3 4 5 6 9 chunks +4 lines, -24 lines 0 comments Download
M extensions/browser/app_window/app_window.cc View 1 2 3 4 7 chunks +10 lines, -87 lines 0 comments Download
M extensions/browser/app_window/app_window_registry.h View 1 2 3 4 2 chunks +0 lines, -3 lines 0 comments Download
M extensions/browser/app_window/app_window_registry.cc View 1 2 3 4 2 chunks +0 lines, -10 lines 0 comments Download
M extensions/common/manifest_handlers/icons_handler.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M extensions/shell/browser/shell_app_delegate.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/shell/browser/shell_app_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 45 (15 generated)
khmel
Hi Mike, PTAL Thanks!
3 years, 7 months ago (2017-05-22 21:21:47 UTC) #3
msw
I find this change a bit confusing (mostly AppWindow and ChromeNativeAppWindowViews); are there active maintainers ...
3 years, 7 months ago (2017-05-23 00:02:34 UTC) #4
James Cook
I'm not particularly familiar with this code. stevenjb@ or sky@ would be better. khmel / ...
3 years, 7 months ago (2017-05-23 15:23:50 UTC) #6
khmel
Thank you Mike and James for taking a look. I am adding Devlin as extensions ...
3 years, 7 months ago (2017-05-23 16:11:44 UTC) #8
stevenjb
I don't really have my head wrapped around this code these days, so mostly a ...
3 years, 7 months ago (2017-05-23 17:00:19 UTC) #9
msw
https://codereview.chromium.org/2900783003/diff/20001/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc File chrome/browser/ui/views/apps/chrome_native_app_window_views.cc (right): https://codereview.chromium.org/2900783003/diff/20001/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc#newcode257 chrome/browser/ui/views/apps/chrome_native_app_window_views.cc:257: const gfx::Image& custom_image = app_window()->custom_app_icon(); On 2017/05/23 16:11:44, khmel ...
3 years, 7 months ago (2017-05-23 17:17:40 UTC) #10
khmel
https://codereview.chromium.org/2900783003/diff/20001/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc File chrome/browser/ui/views/apps/chrome_native_app_window_views.cc (right): https://codereview.chromium.org/2900783003/diff/20001/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc#newcode260 chrome/browser/ui/views/apps/chrome_native_app_window_views.cc:260: app_window()->show_in_shelf()) { On 2017/05/23 17:17:40, msw wrote: > On ...
3 years, 7 months ago (2017-05-23 17:35:00 UTC) #11
msw
looking pretty good, one comment. https://codereview.chromium.org/2900783003/diff/40001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc File chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc (right): https://codereview.chromium.org/2900783003/diff/40001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc#newcode70 chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_controller.cc:70: icon = gfx::Image(*app_icon); On ...
3 years, 7 months ago (2017-05-23 18:13:13 UTC) #12
stevenjb
https://codereview.chromium.org/2900783003/diff/40001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc File chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc (left): https://codereview.chromium.org/2900783003/diff/40001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc#oldcode80 chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc:80: AppWindow* app_window) { On 2017/05/23 17:35:00, khmel wrote: > ...
3 years, 7 months ago (2017-05-23 18:19:23 UTC) #13
khmel
Thanks Steven for pointing that OnAppWindowIconChanged is now deprecated. I discarded that code and refactored ...
3 years, 7 months ago (2017-05-24 20:10:11 UTC) #14
Devlin
Steven knows this code a lot better than I, so I'll wait 'til he's signed ...
3 years, 7 months ago (2017-05-24 20:24:36 UTC) #15
stevenjb
I wish I could say I was more confident of my review than I am, ...
3 years, 7 months ago (2017-05-25 22:25:20 UTC) #16
Devlin
extensions lgtm https://codereview.chromium.org/2900783003/diff/100001/chrome/browser/ui/test/test_app_window_observer.h File chrome/browser/ui/test/test_app_window_observer.h (right): https://codereview.chromium.org/2900783003/diff/100001/chrome/browser/ui/test/test_app_window_observer.h#newcode43 chrome/browser/ui/test/test_app_window_observer.h:43: int expeced_icon_updates_ = 0; typo: expected https://codereview.chromium.org/2900783003/diff/100001/chrome/test/data/extensions/platform_apps/app_icon/test.js ...
3 years, 6 months ago (2017-05-31 22:00:01 UTC) #17
khmel
Thanks Devlin and Steven for review. Adding reveman@ David, Mike, PTAL https://codereview.chromium.org/2900783003/diff/100001/chrome/browser/ui/test/test_app_window_observer.h File chrome/browser/ui/test/test_app_window_observer.h (right): ...
3 years, 6 months ago (2017-06-01 16:56:52 UTC) #19
reveman
https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.h File components/exo/shell_surface.h (right): https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.h#newcode158 components/exo/shell_surface.h:158: static void SetAppIcon(aura::Window* window, const gfx::ImageSkia& icon); Why do ...
3 years, 6 months ago (2017-06-01 18:02:23 UTC) #20
khmel
https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.h File components/exo/shell_surface.h (right): https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.h#newcode158 components/exo/shell_surface.h:158: static void SetAppIcon(aura::Window* window, const gfx::ImageSkia& icon); On 2017/06/01 ...
3 years, 6 months ago (2017-06-01 18:08:20 UTC) #21
reveman
https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.cc File components/exo/shell_surface.cc (right): https://codereview.chromium.org/2900783003/diff/120001/components/exo/shell_surface.cc#newcode45 components/exo/shell_surface.cc:45: DECLARE_UI_CLASS_PROPERTY_TYPE(exo::ShellSurface*) Don't add this. Launcher code can get the ...
3 years, 6 months ago (2017-06-01 18:28:42 UTC) #22
msw
looks pretty good, mostly comment grammar nits. https://codereview.chromium.org/2900783003/diff/120001/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc File chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc (right): https://codereview.chromium.org/2900783003/diff/120001/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc#newcode184 chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc:184: // App ...
3 years, 6 months ago (2017-06-01 19:47:29 UTC) #23
khmel
Thanks for your comments! PTAL updated version. https://codereview.chromium.org/2900783003/diff/120001/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc File chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc (right): https://codereview.chromium.org/2900783003/diff/120001/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc#newcode184 chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc:184: // App ...
3 years, 6 months ago (2017-06-01 21:55:47 UTC) #24
reveman
components/exo lgtm with nits https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc File components/exo/shell_surface.cc (right): https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc#newcode536 components/exo/shell_surface.cc:536: widget_->UpdateWindowIcon(); nit: please leave this ...
3 years, 6 months ago (2017-06-01 22:05:36 UTC) #25
khmel
https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc File components/exo/shell_surface.cc (right): https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc#newcode536 components/exo/shell_surface.cc:536: widget_->UpdateWindowIcon(); On 2017/06/01 22:05:36, reveman wrote: > nit: please ...
3 years, 6 months ago (2017-06-01 22:19:28 UTC) #26
reveman
lgtm https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc File components/exo/shell_surface.cc (right): https://codereview.chromium.org/2900783003/diff/140001/components/exo/shell_surface.cc#newcode536 components/exo/shell_surface.cc:536: widget_->UpdateWindowIcon(); On 2017/06/01 at 22:19:27, khmel wrote: > ...
3 years, 6 months ago (2017-06-01 22:26:00 UTC) #27
msw
lgtm with a few more/repeated comment nits. https://codereview.chromium.org/2900783003/diff/160001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc File chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc (right): https://codereview.chromium.org/2900783003/diff/160001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc#newcode144 chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc:144: // Register ...
3 years, 6 months ago (2017-06-01 23:48:31 UTC) #28
khmel
Thank you for review! https://codereview.chromium.org/2900783003/diff/160001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc File chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc (right): https://codereview.chromium.org/2900783003/diff/160001/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc#newcode144 chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc:144: // Register the window after ...
3 years, 6 months ago (2017-06-02 01:52:36 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2900783003/180001
3 years, 6 months ago (2017-06-02 01:53:41 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/433046)
3 years, 6 months ago (2017-06-02 02:14:02 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2900783003/200001
3 years, 6 months ago (2017-06-02 15:49:03 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/433395)
3 years, 6 months ago (2017-06-02 16:12:21 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2900783003/220001
3 years, 6 months ago (2017-06-02 17:05:18 UTC) #42
commit-bot: I haz the power
3 years, 6 months ago (2017-06-02 19:47:30 UTC) #45
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/1ddcada88969fcf84e5151106058...

Powered by Google App Engine
This is Rietveld 408576698