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

Side by Side Diff: services/ui/public/cpp/lib/window.cc

Issue 2118383002: mus: Disregard windows that explicitly set can_accept_events to be false when sending events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move can_accept_events_ to ui::Window; check if top window can accept events. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/public/cpp/window.h" 5 #include "services/ui/public/cpp/window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 bool Window::HasFocus() const { 441 bool Window::HasFocus() const {
442 return client_ && client_->GetFocusedWindow() == this; 442 return client_ && client_->GetFocusedWindow() == this;
443 } 443 }
444 444
445 void Window::SetCanFocus(bool can_focus) { 445 void Window::SetCanFocus(bool can_focus) {
446 if (client_) 446 if (client_)
447 client_->SetCanFocus(server_id_, can_focus); 447 client_->SetCanFocus(server_id_, can_focus);
448 } 448 }
449 449
450 void Window::SetCanAcceptEvents(bool can_accept_events) {
451 if (client_ && can_accept_events_ != can_accept_events) {
sadrul 2016/07/12 19:44:19 Prefer early return. if (can_accept_events_ ==
riajiang 2016/07/12 20:51:40 Done.
452 client_->SetCanAcceptEvents(server_id_, can_accept_events);
453 can_accept_events_ = can_accept_events;
454 }
455 }
456
450 void Window::Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags) { 457 void Window::Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags) {
451 Embed(std::move(client), base::Bind(&EmptyEmbedCallback), flags); 458 Embed(std::move(client), base::Bind(&EmptyEmbedCallback), flags);
452 } 459 }
453 460
454 void Window::Embed(ui::mojom::WindowTreeClientPtr client, 461 void Window::Embed(ui::mojom::WindowTreeClientPtr client,
455 const EmbedCallback& callback, 462 const EmbedCallback& callback,
456 uint32_t flags) { 463 uint32_t flags) {
457 if (PrepareForEmbed()) 464 if (PrepareForEmbed())
458 client_->Embed(server_id_, std::move(client), flags, callback); 465 client_->Embed(server_id_, std::move(client), flags, callback);
459 else 466 else
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 notifier->NotifyWindowReordered(); 899 notifier->NotifyWindowReordered();
893 900
894 return true; 901 return true;
895 } 902 }
896 903
897 // static 904 // static
898 Window** Window::GetStackingTarget(Window* window) { 905 Window** Window::GetStackingTarget(Window* window) {
899 return &window->stacking_target_; 906 return &window->stacking_target_;
900 } 907 }
901 } // namespace ui 908 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | services/ui/public/cpp/lib/window_tree_client.cc » ('j') | services/ui/public/cpp/window_tree_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698