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

Issue 11419013: Add desktop vs. ash context to ui_controls

Created:
8 years, 1 month ago by scottmg
Modified:
6 years, 6 months ago
Reviewers:
oshima
CC:
chromium-reviews, tfarina, sadrul, ben+watch_chromium.org
Visibility:
Public.

Description

Add desktop vs. ash context to ui_controls Currently, ui_controls methods are global. This patch pulls the methods into a UIControls object that is implemented and installed at startup for the target platform. This is to allow dispatch to either desktop or ash implementations on Windows. ui_controls.cc still contains global (now deprecated) implementations of the methods that forward to the native implementation. So, everything is still wrong on desktop+ash on Windows, but it makes this patch a lot smaller and shouldn't change behavior on any platform. I'll do a follow up CL to change all the callsites to retrieve the correct UIControls object which will make desktop+ash work properly. BUG=128578

Patch Set 1 #

Patch Set 2 : bunch of moving stuff around, links chrome now #

Patch Set 3 : toolkit_views + linux/mac/gtk/native-win #

Patch Set 4 : mac #

Total comments: 22

Patch Set 5 : fix scope for create #

Patch Set 6 : review fixes 2 #

Patch Set 7 : ctors #

Patch Set 8 : mac typo #

Total comments: 10

Patch Set 9 : more review fixes #

Total comments: 6

Patch Set 10 : cleanup #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+711 lines, -504 lines) Patch
M ash/shell.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -2 lines 1 comment Download
M ash/shell_factory.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M ash/ui_controls_ash.cc View 1 9 chunks +16 lines, -16 lines 0 comments Download
M ash/wm/window_properties.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M ash/wm/window_properties.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc View 1 2 3 4 5 6 7 8 9 3 chunks +19 lines, -0 lines 0 comments Download
M content/shell/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/shell_aura.cc View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
A ui/aura/desktop_ui_controls.h View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download
M ui/aura/test/aura_test_helper.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -2 lines 0 comments Download
D ui/aura/ui_controls_aura.h View 1 1 chunk +0 lines, -22 lines 0 comments Download
M ui/aura/ui_controls_win.cc View 1 2 chunks +5 lines, -4 lines 0 comments Download
M ui/aura/ui_controls_x11.cc View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -5 lines 0 comments Download
M ui/ui.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M ui/ui_controls/ui_controls.h View 1 2 3 4 5 4 chunks +101 lines, -21 lines 0 comments Download
A ui/ui_controls/ui_controls.cc View 1 2 3 4 5 6 7 8 1 chunk +116 lines, -0 lines 0 comments Download
M ui/ui_controls/ui_controls_aura.h View 1 1 chunk +0 lines, -58 lines 0 comments Download
M ui/ui_controls/ui_controls_aura.cc View 1 1 chunk +4 lines, -71 lines 0 comments Download
M ui/ui_controls/ui_controls_gtk.cc View 1 2 3 4 5 6 7 8 1 chunk +153 lines, -134 lines 0 comments Download
M ui/ui_controls/ui_controls_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +141 lines, -123 lines 0 comments Download
A ui/ui_controls/ui_controls_type_delegate.h View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M ui/ui_controls/ui_controls_win.cc View 1 2 3 4 5 6 7 8 1 chunk +58 lines, -39 lines 0 comments Download
M ui/views/examples/content_client/examples_browser_main_parts.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
oshima
http://codereview.chromium.org/11419013/diff/12001/ash/shell.cc File ash/shell.cc (right): http://codereview.chromium.org/11419013/diff/12001/ash/shell.cc#newcode213 ash/shell.cc:213: ANNOTATE_LEAKING_OBJECT_PTR(uicontrols); Isn't it possible to delete old one in ...
8 years, 1 month ago (2012-11-15 23:37:41 UTC) #1
scottmg
thanks https://codereview.chromium.org/11419013/diff/12001/ash/shell.cc File ash/shell.cc (right): https://codereview.chromium.org/11419013/diff/12001/ash/shell.cc#newcode213 ash/shell.cc:213: ANNOTATE_LEAKING_OBJECT_PTR(uicontrols); On 2012/11/15 23:37:41, oshima wrote: > Isn't ...
8 years, 1 month ago (2012-11-16 17:58:54 UTC) #2
oshima
http://codereview.chromium.org/11419013/diff/5062/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc File chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc (right): http://codereview.chromium.org/11419013/diff/5062/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc#newcode50 chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc:50: private: nit: new line before private: http://codereview.chromium.org/11419013/diff/5062/ui/ui_controls/ui_controls.cc File ui/ui_controls/ui_controls.cc ...
8 years, 1 month ago (2012-11-16 20:41:39 UTC) #3
scottmg
thank you https://codereview.chromium.org/11419013/diff/5062/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc File chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc (right): https://codereview.chromium.org/11419013/diff/5062/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc#newcode50 chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc:50: private: On 2012/11/16 20:41:39, oshima wrote: > ...
8 years, 1 month ago (2012-11-16 22:34:05 UTC) #4
oshima
lgtm with nits https://codereview.chromium.org/11419013/diff/4034/ash/shell.cc File ash/shell.cc (right): https://codereview.chromium.org/11419013/diff/4034/ash/shell.cc#newcode212 ash/shell.cc:212: ui_controls::UIControls* uicontrols = internal::CreateUIControls(); nit: can ...
8 years, 1 month ago (2012-11-16 23:04:07 UTC) #5
scottmg
thanks. ben (for owners)? https://codereview.chromium.org/11419013/diff/4034/ash/shell.cc File ash/shell.cc (right): https://codereview.chromium.org/11419013/diff/4034/ash/shell.cc#newcode212 ash/shell.cc:212: ui_controls::UIControls* uicontrols = internal::CreateUIControls(); On ...
8 years, 1 month ago (2012-11-16 23:10:28 UTC) #6
Ben Goodger (Google)
There are too many layers here and my head is exploding. Can you just fix ...
8 years, 1 month ago (2012-11-19 20:21:13 UTC) #7
scottmg
On 2012/11/19 20:21:13, Ben Goodger (Google) wrote: > There are too many layers here and ...
8 years, 1 month ago (2012-11-19 20:51:29 UTC) #8
Ben Goodger (Google)
Something that doesn't have a bunch of different objects duct-taped together/replacing each other in various ...
8 years, 1 month ago (2012-11-19 21:19:16 UTC) #9
scottmg
On 2012/11/19 21:19:16, Ben Goodger (Google) wrote: > Something that doesn't have a bunch of ...
8 years, 1 month ago (2012-11-19 23:09:43 UTC) #10
Ben Goodger (Google)
but do the call sites all have a NativeView/Window that corresponds to some window within ...
8 years, 1 month ago (2012-11-19 23:13:18 UTC) #11
scottmg
On 2012/11/19 23:13:18, Ben Goodger (Google) wrote: > but do the call sites all have ...
8 years, 1 month ago (2012-11-20 17:44:06 UTC) #12
scottmg
8 years, 1 month ago (2012-11-20 22:18:11 UTC) #13
Per conversation:

As the majority of uses are in test code, it'd be nice to move ui_controls to
either ui/base/test or chrome/test/base (and maybe merge with ui_test_utils).

I went through usages of ui_controls. The problematic areas I see are:
1. BrowserView::Cut/Copy/Paste
2. AutomationProvider and implementations of it, enable_automation in gyp, and
#if defined(ENABLE_AUTOMATION)
http://code.google.com/searchframe#search/&exact_package=chromium&q=defined+e...

The rest are in test code, or are the implementations of ui_controls in ui,
ui/aura, etc.

For #1, there must be some better way, maybe sending the accelerator command or
equivalent? I'm not exactly sure, but seems solvable.

For #2, it appears that all builds except ios and android always have automation
on. So this one might be a bit harder. It looks like this automation interface
is used for QA (pyauto tests?) and more recently for gpu performance/correctness
tests. I'm not sure if it's reasonable to have a modified build where we include
additional testing code in that case?

Anyone (esp. oshima) know of anything else that might be a problem?

Powered by Google App Engine
This is Rietveld 408576698