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: ui/platform_window/stub/stub_window.cc

Issue 2009853002: Finish eliminating PlatformWindowMus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: From wth->SetBounds to observer on OnWindowBoundsChanging Created 4 years, 7 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/platform_window/stub/stub_window.cc
diff --git a/ui/platform_window/stub/stub_window.cc b/ui/platform_window/stub/stub_window.cc
index a46f89d656dfe7a41f49fe855782c92ee0ea5b8f..bb635531fb75b3d35bfbe060fa93439c553a9b43 100644
--- a/ui/platform_window/stub/stub_window.cc
+++ b/ui/platform_window/stub/stub_window.cc
@@ -4,12 +4,16 @@
#include "ui/platform_window/stub/stub_window.h"
+#include "ui/gfx/native_widget_types.h"
#include "ui/platform_window/platform_window_delegate.h"
namespace ui {
-StubWindow::StubWindow(PlatformWindowDelegate* delegate) : delegate_(delegate) {
- delegate_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget, 1.f);
+StubWindow::StubWindow(
+ PlatformWindowDelegate* delegate, gfx::AcceleratedWidget accelerated_widget)
+ : delegate_(delegate) {
+ if (delegate_)
+ delegate_->OnAcceleratedWidgetAvailable(accelerated_widget, 1.f);
}
StubWindow::~StubWindow() {
@@ -22,14 +26,16 @@ void StubWindow::Hide() {
}
void StubWindow::Close() {
- delegate_->OnClosed();
+ if (delegate_)
+ delegate_->OnClosed();
}
void StubWindow::SetBounds(const gfx::Rect& bounds) {
if (bounds_ == bounds)
return;
bounds_ = bounds;
- delegate_->OnBoundsChanged(bounds);
+ if (delegate_)
+ delegate_->OnBoundsChanged(bounds);
}
gfx::Rect StubWindow::GetBounds() {

Powered by Google App Engine
This is Rietveld 408576698