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

Unified Diff: ui/views/mus/native_widget_mus.cc

Issue 1423133003: Routes calls to WM through WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no braces Created 5 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
« no previous file with comments | « ui/views/mus/native_widget_mus.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/native_widget_mus.cc
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
index 6885489e23325e6460aaed451be1b7e70331dc41..1e6062e672ee11032b2c88e323eb67c30da6651b 100644
--- a/ui/views/mus/native_widget_mus.cc
+++ b/ui/views/mus/native_widget_mus.cc
@@ -61,8 +61,6 @@ class ContentWindowLayoutManager : public aura::LayoutManager {
DISALLOW_COPY_AND_ASSIGN(ContentWindowLayoutManager);
};
-void WindowManagerCallback(mus::mojom::WindowManagerErrorCode error_code) {}
-
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -74,7 +72,6 @@ NativeWidgetMus::NativeWidgetMus(internal::NativeWidgetDelegate* delegate,
: window_(window),
shell_(shell),
native_widget_delegate_(delegate),
- window_manager_(nullptr),
show_state_before_fullscreen_(mus::mojom::SHOW_STATE_RESTORED),
content_(new aura::Window(this)) {}
NativeWidgetMus::~NativeWidgetMus() {}
@@ -207,11 +204,7 @@ ui::InputMethod* NativeWidgetMus::GetInputMethod() {
void NativeWidgetMus::CenterWindow(const gfx::Size& size) {
// TODO(beng): clear user-placed property and set preferred size property.
- if (!window_manager_)
- return;
- window_manager_->SetPreferredSize(window_tree_host_->mus_window()->id(),
- mojo::Size::From(size),
- base::Bind(&WindowManagerCallback));
+ window_->SetPreferredSize(size);
}
void NativeWidgetMus::GetWindowPlacement(
@@ -251,23 +244,13 @@ gfx::Rect NativeWidgetMus::GetRestoredBounds() const {
}
void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
- if (!window_manager_)
- return;
- window_manager_->SetBounds(window_tree_host_->mus_window()->id(),
- mojo::Rect::From(bounds),
- base::Bind(&WindowManagerCallback));
+ window_->RequestBoundsChange(bounds);
}
void NativeWidgetMus::SetSize(const gfx::Size& size) {
- if (!window_manager_)
- return;
- mojo::RectPtr bounds(mojo::Rect::New());
- bounds->x = window_tree_host_->mus_window()->bounds().x;
- bounds->y = window_tree_host_->mus_window()->bounds().y;
- bounds->width = size.width();
- bounds->height = size.height();
- window_manager_->SetBounds(window_tree_host_->mus_window()->id(),
- bounds.Pass(), base::Bind(&WindowManagerCallback));
+ gfx::Rect bounds = window_->bounds().To<gfx::Rect>();
+ bounds.set_size(size);
+ window_->RequestBoundsChange(bounds);
}
void NativeWidgetMus::StackAbove(gfx::NativeView native_view) {
« no previous file with comments | « ui/views/mus/native_widget_mus.h ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698