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

Issue 2821213002: chromeos: converts ash devtools to aura::Window (Closed)

Created:
3 years, 8 months ago by sky
Modified:
3 years, 8 months ago
Reviewers:
sadrul, alokp
CC:
chromium-reviews, kalyank, sadrul, pfeldman, devtools-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

chromeos: converts ash devtools to aura::Window BUG=687656 TEST=covered by tests R=sadrul@chromium.org Review-Url: https://codereview.chromium.org/2821213002 Cr-Commit-Position: refs/heads/master@{#465299} Committed: https://chromium.googlesource.com/chromium/src/+/3e82c5b9d88086ead8bbbd122eef8c1b5d45f5e3

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : fix cast #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -153 lines) Patch
M ash/devtools/ash_devtools_css_agent.h View 1 chunk +1 line, -1 line 0 comments Download
M ash/devtools/ash_devtools_css_agent.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M ash/devtools/ash_devtools_dom_agent.h View 5 chunks +15 lines, -13 lines 0 comments Download
M ash/devtools/ash_devtools_dom_agent.cc View 15 chunks +46 lines, -45 lines 0 comments Download
M ash/devtools/ash_devtools_unittest.cc View 25 chunks +70 lines, -75 lines 0 comments Download
M ash/test/ash_test_base.h View 1 2 chunks +9 lines, -0 lines 0 comments Download
M ash/test/ash_test_base.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M chromecast/graphics/cast_focus_client_aura.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chromecast/graphics/cast_focus_client_aura.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/default_activation_client.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/default_activation_client.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M ui/wm/core/focus_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/focus_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/window_util.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/window_util.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/wm/public/activation_client.h View 2 chunks +7 lines, -1 line 4 comments Download
M ui/wm/public/activation_client.cc View 1 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
sky
3 years, 8 months ago (2017-04-18 04:04:03 UTC) #1
sky
+alokp for chromecast
3 years, 8 months ago (2017-04-18 15:13:42 UTC) #10
alokp
rs lgtm https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h File ui/wm/public/activation_client.h (right): https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h#newcode35 ui/wm/public/activation_client.h:35: virtual const Window* GetActiveWindow() const = 0; ...
3 years, 8 months ago (2017-04-18 16:57:29 UTC) #13
sky
https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h File ui/wm/public/activation_client.h (right): https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h#newcode35 ui/wm/public/activation_client.h:35: virtual const Window* GetActiveWindow() const = 0; On 2017/04/18 ...
3 years, 8 months ago (2017-04-18 17:16:05 UTC) #14
sadrul
lgtm
3 years, 8 months ago (2017-04-18 17:36:11 UTC) #15
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/2821213002/40001
3 years, 8 months ago (2017-04-18 18:14:32 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/3e82c5b9d88086ead8bbbd122eef8c1b5d45f5e3
3 years, 8 months ago (2017-04-18 18:47:07 UTC) #20
alokp
https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h File ui/wm/public/activation_client.h (right): https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation_client.h#newcode35 ui/wm/public/activation_client.h:35: virtual const Window* GetActiveWindow() const = 0; > This ...
3 years, 8 months ago (2017-04-18 18:48:33 UTC) #21
sky
3 years, 8 months ago (2017-04-18 19:08:13 UTC) #22
Message was sent while issue was closed.
https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation...
File ui/wm/public/activation_client.h (right):

https://codereview.chromium.org/2821213002/diff/40001/ui/wm/public/activation...
ui/wm/public/activation_client.h:35: virtual const Window* GetActiveWindow()
const = 0;
On 2017/04/18 18:48:33, alokp wrote:
> > This function is intended to be a trivial getter, hence the const.
> 
> Which is what I meant by making assumptions about the implementation (trivial
> getter) of derived classes :)
> 
> > If this
> > function isn't const, it means it is not possible (without const-casts) to
> > determine if a const Window is active. That seems wrong.
> 
> May be I am missing something, but I do not see any problem in
> wm::IsActiveWindow taking a const Window and ActivationClient::GetActiveWindow
> returning a const or non-const window. I do not see why
> ActivationClient::GetActiveWindow needs to be a const function.

IsActiveWindow() requires the ActivationClient, which is found from the root
window, e.g.:

const aura::Window* root = window->GetRootWindow();

If |window| is const, then root must also be const. If it wasn't, meaning you
could get the non-const root given a const, it would mean you could effectively
circumvent the const'ness of the window.

Similarly, when getting the ActivationClient for the root, if the root is const
then so should the ActivationClient be:

const ActivationClient* activation_client = root->GetProperty(...);

Why should the ActivationClient be const? For the same reason as above, if it
didn't return a const ActivationClient it would mean you can circumvent the
const'ness of the underlying window.

As this point we have a const ActivationClient. Again, const functions should
return const objects, otherwise you can circumvent the const'ness. That means we
need GetActiveWindow() to be const and return a const object.

> This is all super-nit bike-shedding though :)

Indeed.

Powered by Google App Engine
This is Rietveld 408576698