Commit 72925754 authored by markdittmer's avatar markdittmer Committed by Commit bot

Drop unnecessary override of OnWindowBoundsChanged in NativeWidgetMus::MusWindowObserver

R=sky@chromium.org
BUG=617315

Review-Url: https://codereview.chromium.org/2040783002
Cr-Commit-Position: refs/heads/master@{#398125}
parent 27d739cb
......@@ -6,6 +6,7 @@ component("stub") {
output_name = "stub_window"
deps = [
"//base",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/platform_window",
......
......@@ -4,12 +4,16 @@
#include "ui/platform_window/stub/stub_window.h"
#include "base/logging.h"
#include "ui/platform_window/platform_window_delegate.h"
namespace ui {
StubWindow::StubWindow(PlatformWindowDelegate* delegate) : delegate_(delegate) {
if (delegate_)
StubWindow::StubWindow(PlatformWindowDelegate* delegate,
bool use_default_accelerated_widget)
: delegate_(delegate) {
DCHECK(delegate);
if (use_default_accelerated_widget)
delegate_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget, 1.f);
}
......@@ -23,16 +27,14 @@ void StubWindow::Hide() {
}
void StubWindow::Close() {
if (delegate_)
delegate_->OnClosed();
delegate_->OnClosed();
}
void StubWindow::SetBounds(const gfx::Rect& bounds) {
if (bounds_ == bounds)
return;
bounds_ = bounds;
if (delegate_)
delegate_->OnBoundsChanged(bounds);
delegate_->OnBoundsChanged(bounds);
}
gfx::Rect StubWindow::GetBounds() {
......
......@@ -10,6 +10,7 @@
'target_name': 'stub_window',
'type': '<(component)',
'dependencies': [
'../../../base/base.gyp:base',
'../../gfx/gfx.gyp:gfx',
'../../gfx/gfx.gyp:gfx_geometry',
'../platform_window.gyp:platform_window',
......
......@@ -15,7 +15,8 @@ namespace ui {
class STUB_WINDOW_EXPORT StubWindow : NON_EXPORTED_BASE(public PlatformWindow) {
public:
explicit StubWindow(PlatformWindowDelegate* delegate);
StubWindow(PlatformWindowDelegate* delegate,
bool use_default_accelerated_widget = true);
~StubWindow() override;
private:
......
......@@ -365,11 +365,6 @@ class NativeWidgetMus::MusWindowObserver : public mus::WindowObserver {
void OnWindowVisibilityChanged(mus::Window* window) override {
native_widget_mus_->OnMusWindowVisibilityChanged(window);
}
void OnWindowBoundsChanged(mus::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override {
platform_window_delegate()->OnBoundsChanged(new_bounds);
}
void OnWindowPredefinedCursorChanged(mus::Window* window,
mus::mojom::Cursor cursor) override {
DCHECK_EQ(window, mus_window());
......
......@@ -38,7 +38,10 @@ WindowTreeHostMus::WindowTreeHostMus(NativeWidgetMus* native_widget,
// TODO(markdittmer): Use correct device-scale-factor from |window|.
OnAcceleratedWidgetAvailable(accelerated_widget, 1.f);
SetPlatformWindow(base::WrapUnique(new ui::StubWindow(nullptr)));
SetPlatformWindow(base::WrapUnique(new ui::StubWindow(
this,
false))); // Do not advertise accelerated widget; already set manually.
// Initialize the stub platform window bounds to those of the mus::Window.
platform_window()->SetBounds(window->bounds());
......
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