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

Side by Side Diff: components/mus/public/cpp/lib/window.cc

Issue 2068093002: mus: Allow embedder to intercept events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 6 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
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_tree_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/mus/public/cpp/window.h" 5 #include "components/mus/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::Embed(mus::mojom::WindowTreeClientPtr client) { 450 void Window::Embed(mus::mojom::WindowTreeClientPtr client, uint32_t flags) {
451 Embed(std::move(client), base::Bind(&EmptyEmbedCallback)); 451 Embed(std::move(client), base::Bind(&EmptyEmbedCallback), flags);
452 } 452 }
453 453
454 void Window::Embed(mus::mojom::WindowTreeClientPtr client, 454 void Window::Embed(mus::mojom::WindowTreeClientPtr client,
455 const EmbedCallback& callback) { 455 const EmbedCallback& callback,
456 uint32_t flags) {
456 if (PrepareForEmbed()) 457 if (PrepareForEmbed())
457 client_->Embed(server_id_, std::move(client), callback); 458 client_->Embed(server_id_, std::move(client), flags, callback);
458 else 459 else
459 callback.Run(false); 460 callback.Run(false);
460 } 461 }
461 462
462 void Window::RequestClose() { 463 void Window::RequestClose() {
463 if (client_) 464 if (client_)
464 client_->RequestClose(this); 465 client_->RequestClose(this);
465 } 466 }
466 467
467 std::string Window::GetName() const { 468 std::string Window::GetName() const {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 notifier->NotifyWindowReordered(); 882 notifier->NotifyWindowReordered();
882 883
883 return true; 884 return true;
884 } 885 }
885 886
886 // static 887 // static
887 Window** Window::GetStackingTarget(Window* window) { 888 Window** Window::GetStackingTarget(Window* window) {
888 return &window->stacking_target_; 889 return &window->stacking_target_;
889 } 890 }
890 } // namespace mus 891 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698