Commit cb2a0cf8 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Remove NativeAppWindowViews::Layout

This is better served with a FillLayout and Bounds Change View Observer.

BUG=1005568
TEST=browser_tests AppWindowBrowserTest.*

Change-Id: I7c93be420241fc95c67479ae14a6c8a49d075890
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827943
Commit-Queue: Trent Apted <tapted@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Auto-Submit: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702638}
parent 7c5df5dc
......@@ -12,6 +12,7 @@
#include "extensions/common/draggable_region.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/non_client_view.h"
......@@ -21,7 +22,9 @@
namespace native_app_window {
NativeAppWindowViews::NativeAppWindowViews() = default;
NativeAppWindowViews::NativeAppWindowViews() {
SetLayoutManager(std::make_unique<views::FillLayout>());
}
void NativeAppWindowViews::Init(
extensions::AppWindow* app_window,
......@@ -307,12 +310,6 @@ void NativeAppWindowViews::RenderViewHostChanged(
// views::View implementation.
void NativeAppWindowViews::Layout() {
DCHECK(web_view_);
web_view_->SetBounds(0, 0, width(), height());
OnViewWasResized();
}
void NativeAppWindowViews::ViewHierarchyChanged(
const views::ViewHierarchyChangedDetails& details) {
if (details.is_add && details.child == this) {
......@@ -330,6 +327,10 @@ gfx::Size NativeAppWindowViews::GetMaximumSize() const {
return size_constraints_.GetMaximumSize();
}
void NativeAppWindowViews::OnBoundsChanged(const gfx::Rect& previous_bounds) {
OnViewWasResized();
}
void NativeAppWindowViews::OnFocus() {
web_view_->RequestFocus();
}
......
......@@ -116,11 +116,11 @@ class NativeAppWindowViews : public extensions::NativeAppWindow,
content::RenderViewHost* new_host) override;
// views::View implementation.
void Layout() override;
void ViewHierarchyChanged(
const views::ViewHierarchyChangedDetails& details) override;
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void OnFocus() override;
// NativeAppWindow implementation.
......
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