Commit 21b59335 authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

views: Remove NativeViewHost::SetPreferredSize

Remove NativeViewHost::SetPreferredSize since it is implemented in
View now. The View impl notifies parent only when the preferred
size really changes.

Bug: 830093
Change-Id: I3887b3103e45fc06771f68c469258fb4e53bf4e0
Reviewed-on: https://chromium-review.googlesource.com/1002918Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549285}
parent 54474b82
......@@ -48,11 +48,6 @@ void NativeViewHost::Detach() {
Detach(false);
}
void NativeViewHost::SetPreferredSize(const gfx::Size& size) {
preferred_size_ = size;
PreferredSizeChanged();
}
bool NativeViewHost::SetCornerRadius(int corner_radius) {
return native_wrapper_->SetCornerRadius(corner_radius);
}
......@@ -73,10 +68,6 @@ void NativeViewHost::NativeViewDestroyed() {
////////////////////////////////////////////////////////////////////////////////
// NativeViewHost, View overrides:
gfx::Size NativeViewHost::CalculatePreferredSize() const {
return preferred_size_;
}
void NativeViewHost::Layout() {
if (!native_view_ || !native_wrapper_.get())
return;
......
......@@ -47,9 +47,6 @@ class VIEWS_EXPORT NativeViewHost : public View {
// detached before calling this function, and this has no effect in that case.
void Detach();
// Sets a preferred size for the native view attached to this View.
void SetPreferredSize(const gfx::Size& size);
// Sets the corner radius for clipping gfx::NativeView. Returns true on
// success or false if the platform doesn't support the operation.
// NB: This does not interact nicely with fast_resize.
......@@ -86,7 +83,6 @@ class VIEWS_EXPORT NativeViewHost : public View {
void NativeViewDestroyed();
// Overridden from View:
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
void OnPaint(gfx::Canvas* canvas) override;
void VisibilityChanged(View* starting_from, bool is_visible) override;
......@@ -120,9 +116,6 @@ class VIEWS_EXPORT NativeViewHost : public View {
// attached gfx::NativeView.
std::unique_ptr<NativeViewHostWrapper> native_wrapper_;
// The preferred size of this View
gfx::Size preferred_size_;
// The actual size of the NativeView, or an empty size if no scaling of the
// NativeView should occur.
gfx::Size native_view_size_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment