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

Issue 658923003: Remove dependency on ui from view_manager. (Closed)

Created:
6 years, 2 months ago by jam
Modified:
6 years, 1 month ago
CC:
qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, mojo-reviews_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Visibility:
Public.

Description

Remove dependency on ui from view_manager. This removes unnecessary dependencies like skia, freetype and many others. Instead of using geometry types from gfx, use the simple types already in mojo. R=ben@chromium.org, sky@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/ed8d84dd3ef77703a215583ac28abb88f5aaae8e

Patch Set 1 #

Patch Set 2 : #

Total comments: 3

Patch Set 3 : Remove .Clone() by adding To() to generated structs #

Patch Set 4 : rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -131 lines) Patch
M mojo/aura/window_tree_host_mojo.h View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/aura/window_tree_host_mojo.cc View 1 2 3 chunks +9 lines, -6 lines 0 comments Download
M mojo/converters/geometry/geometry_type_converters.h View 1 2 1 chunk +9 lines, -0 lines 3 comments Download
M mojo/converters/geometry/geometry_type_converters.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M mojo/examples/bitmap_uploader/bitmap_uploader.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/examples/browser/browser.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M mojo/examples/keyboard/keyboard.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/examples/media_viewer/media_viewer.cc View 3 chunks +10 lines, -6 lines 0 comments Download
M mojo/examples/nesting_app/nesting_app.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M mojo/examples/png_viewer/png_viewer.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M mojo/examples/window_manager/debug_panel.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/examples/window_manager/window_manager.cc View 1 12 chunks +51 lines, -44 lines 0 comments Download
M mojo/examples/wm_flow/app/app.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M mojo/examples/wm_flow/wm/frame_controller.cc View 1 2 4 chunks +6 lines, -4 lines 0 comments Download
M mojo/examples/wm_flow/wm/wm.cc View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/services/public/cpp/view_manager/BUILD.gn View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M mojo/services/public/cpp/view_manager/lib/view.cc View 4 chunks +11 lines, -8 lines 0 comments Download
M mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h View 1 2 chunks +1 line, -2 lines 0 comments Download
M mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc View 1 2 3 3 chunks +4 lines, -6 lines 0 comments Download
M mojo/services/public/cpp/view_manager/lib/view_private.h View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc View 1 2 3 4 chunks +24 lines, -5 lines 0 comments Download
M mojo/services/public/cpp/view_manager/tests/view_unittest.cc View 4 chunks +9 lines, -7 lines 0 comments Download
M mojo/services/public/cpp/view_manager/view.h View 4 chunks +5 lines, -5 lines 0 comments Download
M mojo/services/public/cpp/view_manager/view_observer.h View 1 2 chunks +4 lines, -8 lines 0 comments Download
M mojo/services/window_manager/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/services/window_manager/window_manager_app.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/services/window_manager/window_manager_app.cc View 1 2 3 4 chunks +6 lines, -5 lines 0 comments Download
M mojo/views/native_widget_view_manager.h View 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/views/native_widget_view_manager.cc View 1 2 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
jam
This drops the dependencies from $ gn desc out/Default/ //mojo/services/public/cpp/view_manager:view_manager libs gmodule-2.0 gobject-2.0 gthread-2.0 rt ...
6 years, 2 months ago (2014-10-23 14:57:09 UTC) #2
jam
+mojo-reviews since this checkout doesn't have the update to codereview.settings
6 years, 2 months ago (2014-10-23 14:58:13 UTC) #3
Ben Goodger (Google)
lgtm https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc File mojo/examples/wm_flow/wm/frame_controller.cc (right): https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc#newcode140 mojo/examples/wm_flow/wm/frame_controller.cc:140: restored_bounds_ = view_->bounds().Clone().To<gfx::Rect>(); this is the weirdness
6 years, 2 months ago (2014-10-23 15:11:08 UTC) #4
jam
https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc File mojo/examples/wm_flow/wm/frame_controller.cc (right): https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc#newcode140 mojo/examples/wm_flow/wm/frame_controller.cc:140: restored_bounds_ = view_->bounds().Clone().To<gfx::Rect>(); On 2014/10/23 15:11:08, Ben Goodger (Google) ...
6 years, 2 months ago (2014-10-23 15:19:53 UTC) #5
jam
https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc File mojo/examples/wm_flow/wm/frame_controller.cc (right): https://codereview.chromium.org/658923003/diff/20001/mojo/examples/wm_flow/wm/frame_controller.cc#newcode140 mojo/examples/wm_flow/wm/frame_controller.cc:140: restored_bounds_ = view_->bounds().Clone().To<gfx::Rect>(); On 2014/10/23 15:19:53, jam wrote: > ...
6 years, 2 months ago (2014-10-23 20:49:48 UTC) #6
jam
+sky for latest patchset (3) since ben is gone
6 years, 2 months ago (2014-10-23 20:52:48 UTC) #8
sky
LGTM
6 years, 2 months ago (2014-10-23 21:05:38 UTC) #9
jam
Committed patchset #4 (id:60001) manually as ed8d84dd3ef77703a215583ac28abb88f5aaae8e (presubmit successful).
6 years, 2 months ago (2014-10-23 21:27:13 UTC) #10
darin (slow to review)
https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry/geometry_type_converters.h File mojo/converters/geometry/geometry_type_converters.h (right): https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry/geometry_type_converters.h#newcode46 mojo/converters/geometry/geometry_type_converters.h:46: struct MOJO_GEOMETRY_EXPORT TypeConverter<RectPtr, gfx::Rect> { it seems like this ...
6 years, 2 months ago (2014-10-24 04:37:15 UTC) #12
jam
https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry/geometry_type_converters.h File mojo/converters/geometry/geometry_type_converters.h (right): https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry/geometry_type_converters.h#newcode46 mojo/converters/geometry/geometry_type_converters.h:46: struct MOJO_GEOMETRY_EXPORT TypeConverter<RectPtr, gfx::Rect> { On 2014/10/24 04:37:15, darin ...
6 years, 2 months ago (2014-10-24 17:15:05 UTC) #13
yzshen1
6 years, 1 month ago (2014-10-27 16:55:19 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry...
File mojo/converters/geometry/geometry_type_converters.h (right):

https://codereview.chromium.org/658923003/diff/60001/mojo/converters/geometry...
mojo/converters/geometry/geometry_type_converters.h:46: struct
MOJO_GEOMETRY_EXPORT TypeConverter<RectPtr, gfx::Rect> {
On 2014/10/24 17:15:05, jam wrote:
> On 2014/10/24 04:37:15, darin wrote:
> > it seems like this should be expressible in terms of the newly minted
> > TypeConverter<Rect, gfx::Rect> class. we should be able to write a generic
> > flavor of TypeConverter<StructPtr<S>, U> that utilizes TypeConverter<S, U>.
> > probably something to explore as a separate CL.
> 
> I had tried to do this but couldn't figure out one way to access the rect
> members for both RectPtr and mojo::Rect. also the construction of the return
> type, and how it's returned, is different (i.e. "RectPtr rect(Rect::New());"
and
> "Rect rect;"). Would I need to have some other type as a parameter to the
> template which contains this knowledge? Any suggestions or examples to look
at?

(Drive-by comments; no need to wait for my LG.)

I think if we are willing to change the Convert() signature, we could write it
this way:

template<>
struct TypeConverter<StructPtr<S>, U> {
  static Convert(const U& input, StructPtr<S>* output) {
    output->Swap(S::New());
    TypeConverter<S, U>::Convert(input, output->get());
  }
};

And we also need a specialization for InlinedStructPtr<>.
template<>
struct TypeConverter<InlinedStructPtr<S>, U> {
  // Similar to the one above
};

Powered by Google App Engine
This is Rietveld 408576698