Chromium Code Reviews| Index: components/mus/ws/window_tree.cc |
| diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc |
| index 6a1dd4fc64640a2f8cb9392f9a29d1cc8660fbdd..23910269b378fc775bd1539ba431ec0bdb03e648 100644 |
| --- a/components/mus/ws/window_tree.cc |
| +++ b/components/mus/ws/window_tree.cc |
| @@ -294,18 +294,28 @@ bool WindowTree::SetWindowOpacity(const ClientWindowId& window_id, |
| bool WindowTree::SetFocus(const ClientWindowId& window_id) { |
| ServerWindow* window = GetWindowByClientId(window_id); |
| ServerWindow* currently_focused = window_server_->GetFocusedWindow(); |
| - if (!currently_focused && !window) |
| + if (!currently_focused && !window) { |
| + LOG(WARNING) << "SetFocus failure, no focused window to clear."; |
|
sky
2016/05/16 19:44:27
I think these should be DVLOGs.
James Cook
2016/05/16 20:57:44
How about DLOG? My concern with DVLOG is that no o
James Cook
2016/05/16 21:43:01
Discussed offline, switched to DVLOG.
|
| return false; |
| + } |
| Display* display = GetDisplay(window); |
| - if (window && (!display || !window->can_focus() || !window->IsDrawn())) |
| + if (window && (!display || !window->can_focus() || !window->IsDrawn())) { |
| + LOG(WARNING) << "SetFocus failure, window cannot be focused."; |
| return false; |
| + } |
| - if (!access_policy_->CanSetFocus(window)) |
| + if (!access_policy_->CanSetFocus(window)) { |
| + LOG(WARNING) << "SetFocus failure, blocked by access policy."; |
| return false; |
| + } |
| Operation op(this, window_server_, OperationType::SET_FOCUS); |
| - return window_server_->SetFocusedWindow(window); |
| + bool success = window_server_->SetFocusedWindow(window); |
| + if (!success) { |
| + LOG(WARNING) << "SetFocus failure, could not SetFocusedWindow."; |
| + } |
| + return success; |
| } |
| bool WindowTree::Embed(const ClientWindowId& window_id, |