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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1983243002: Creates mus test helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override 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
« no previous file with comments | « no previous file | components/mus/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index 4c662c67b41b7cb7bc37271c50c722df6c864e02..7fd7995376f45a7ab0554b6dd813b4233078647f 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -1032,7 +1032,8 @@ void WindowTreeClientImpl::WmSetBounds(uint32_t change_id,
window->SetBounds(bounds);
}
}
- window_manager_internal_client_->WmResponse(change_id, result);
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(change_id, result);
}
void WindowTreeClientImpl::WmSetProperty(uint32_t change_id,
@@ -1055,7 +1056,8 @@ void WindowTreeClientImpl::WmSetProperty(uint32_t change_id,
window->SetSharedPropertyInternal(name, data.get());
}
}
- window_manager_internal_client_->WmResponse(change_id, result);
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->WmResponse(change_id, result);
}
void WindowTreeClientImpl::WmCreateTopLevelWindow(
@@ -1065,8 +1067,10 @@ void WindowTreeClientImpl::WmCreateTopLevelWindow(
transport_properties.To<std::map<std::string, std::vector<uint8_t>>>();
Window* window =
window_manager_delegate_->OnWmCreateTopLevelWindow(&properties);
- window_manager_internal_client_->OnWmCreatedTopLevelWindow(change_id,
- server_id(window));
+ if (window_manager_internal_client_) {
+ window_manager_internal_client_->OnWmCreatedTopLevelWindow(
+ change_id, server_id(window));
+ }
}
void WindowTreeClientImpl::OnAccelerator(uint32_t id, mojom::EventPtr event) {
@@ -1076,8 +1080,10 @@ void WindowTreeClientImpl::OnAccelerator(uint32_t id, mojom::EventPtr event) {
void WindowTreeClientImpl::SetFrameDecorationValues(
mojom::FrameDecorationValuesPtr values) {
- window_manager_internal_client_->WmSetFrameDecorationValues(
- std::move(values));
+ if (window_manager_internal_client_) {
+ window_manager_internal_client_->WmSetFrameDecorationValues(
+ std::move(values));
+ }
}
void WindowTreeClientImpl::SetNonClientCursor(Window* window,
@@ -1090,32 +1096,42 @@ void WindowTreeClientImpl::AddAccelerator(
uint32_t id,
mojom::EventMatcherPtr event_matcher,
const base::Callback<void(bool)>& callback) {
- window_manager_internal_client_->AddAccelerator(id, std::move(event_matcher),
- callback);
+ if (window_manager_internal_client_) {
+ window_manager_internal_client_->AddAccelerator(
+ id, std::move(event_matcher), callback);
+ }
}
void WindowTreeClientImpl::RemoveAccelerator(uint32_t id) {
- window_manager_internal_client_->RemoveAccelerator(id);
+ if (window_manager_internal_client_) {
+ window_manager_internal_client_->RemoveAccelerator(id);
+ }
}
void WindowTreeClientImpl::AddActivationParent(Window* window) {
- window_manager_internal_client_->AddActivationParent(server_id(window));
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->AddActivationParent(server_id(window));
}
void WindowTreeClientImpl::RemoveActivationParent(Window* window) {
- window_manager_internal_client_->RemoveActivationParent(server_id(window));
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->RemoveActivationParent(server_id(window));
}
void WindowTreeClientImpl::ActivateNextWindow() {
- window_manager_internal_client_->ActivateNextWindow();
+ if (window_manager_internal_client_)
+ window_manager_internal_client_->ActivateNextWindow();
}
void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea(
Window* window,
const gfx::Vector2d& offset,
const gfx::Insets& hit_area) {
- window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
- server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area));
+ if (window_manager_internal_client_) {
+ window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea(
+ server_id(window), offset.x(), offset.y(),
+ mojo::Insets::From(hit_area));
+ }
}
} // namespace mus
« no previous file with comments | « no previous file | components/mus/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698