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

Unified Diff: services/ui/view_manager/view_tree_state.h

Issue 1774393002: Mozart: Add ViewInspector contracts for hit testing. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/view_manager/view_registry.cc ('k') | services/ui/view_manager/view_tree_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/view_manager/view_tree_state.h
diff --git a/services/ui/view_manager/view_tree_state.h b/services/ui/view_manager/view_tree_state.h
index b270721ca979070c06da228c07fe7c08c2f55380..acb5941e5526ace679a32be995bae5e5b8f9cd98 100644
--- a/services/ui/view_manager/view_tree_state.h
+++ b/services/ui/view_manager/view_tree_state.h
@@ -52,9 +52,7 @@ class ViewTreeState {
// The view tree's renderer.
mojo::gfx::composition::Renderer* renderer() const { return renderer_.get(); }
- void set_renderer(mojo::gfx::composition::RendererPtr renderer) {
- renderer_ = renderer.Pass();
- }
+ void SetRenderer(mojo::gfx::composition::RendererPtr renderer);
// Gets the root of the view tree, or null if there is no root.
ViewStub* root() const { return root_.get(); }
@@ -75,10 +73,20 @@ class ViewTreeState {
bool layout_request_issued() const { return layout_request_issued_; }
void set_layout_request_issued(bool value) { layout_request_issued_ = value; }
+ // Starts tracking a hit tester request.
+ // The request will be satisfied by the current renderer if possible.
+ // The callback will be invoked when the renderer changes.
+ void RequestHitTester(
+ mojo::InterfaceRequest<mojo::gfx::composition::HitTester>
+ hit_tester_request,
+ const mojo::ui::ViewInspector::GetHitTesterCallback& callback);
+
const std::string& label() const { return label_; }
const std::string& FormattedLabel() const;
private:
+ void ClearHitTesterCallbacks(bool renderer_changed);
+
mojo::ui::ViewTreeTokenPtr view_tree_token_;
mojo::ui::ViewTreeListenerPtr view_tree_listener_;
@@ -94,6 +102,9 @@ class ViewTreeState {
bool layout_request_pending_ = false;
bool layout_request_issued_ = false;
+ std::vector<mojo::ui::ViewInspector::GetHitTesterCallback>
+ pending_hit_tester_callbacks_;
+
base::WeakPtrFactory<ViewTreeState> weak_factory_; // must be last
DISALLOW_COPY_AND_ASSIGN(ViewTreeState);
« no previous file with comments | « services/ui/view_manager/view_registry.cc ('k') | services/ui/view_manager/view_tree_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698