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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 2390953004: WidgetDelegateView is its own contents view. (Closed)
Patch Set: another minor fix Created 4 years, 2 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
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 1e80313596406b892fb638a4e9fe3bc6713c5138..201e6d04c8530e48613be392aac8907660e155db 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -237,7 +237,6 @@ class TouchSelectionControllerImpl::EditingHandleView
draw_invisible_(false),
weak_ptr_factory_(this) {
widget_.reset(CreateTouchSelectionPopupWidget(context, this));
- widget_->SetContentsView(this);
aura::Window* window = widget_->GetNativeWindow();
window->SetEventTargeter(std::unique_ptr<ui::EventTargeter>(
@@ -321,6 +320,10 @@ class TouchSelectionControllerImpl::EditingHandleView
}
gfx::Size GetPreferredSize() const override {
+ // This function will be called during widget initialization, i.e. before
+ // SetBoundInScreen has been called. No-op in that case.
+ if (selection_bound_.type() == gfx::SelectionBound::EMPTY)
+ return gfx::Size();
return GetSelectionWidgetBounds(selection_bound_).size();
}

Powered by Google App Engine
This is Rietveld 408576698