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

Side by Side Diff: ui/aura/mus/window_tree_client.h

Issue 2456843004: Wires up transient windows for aura-mus (Closed)
Patch Set: Created 4 years, 1 month 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 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 5 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/atomicops.h" 16 #include "base/atomicops.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "mojo/public/cpp/bindings/associated_binding.h" 21 #include "mojo/public/cpp/bindings/associated_binding.h"
22 #include "mojo/public/cpp/bindings/strong_binding.h" 22 #include "mojo/public/cpp/bindings/strong_binding.h"
23 #include "services/ui/public/interfaces/window_tree.mojom.h" 23 #include "services/ui/public/interfaces/window_tree.mojom.h"
24 #include "ui/aura/aura_export.h" 24 #include "ui/aura/aura_export.h"
25 #include "ui/aura/client/capture_client_observer.h" 25 #include "ui/aura/client/capture_client_observer.h"
26 #include "ui/aura/client/focus_change_observer.h" 26 #include "ui/aura/client/focus_change_observer.h"
27 #include "ui/aura/client/transient_window_client_observer.h"
27 #include "ui/aura/mus/mus_types.h" 28 #include "ui/aura/mus/mus_types.h"
28 #include "ui/aura/mus/window_manager_delegate.h" 29 #include "ui/aura/mus/window_manager_delegate.h"
29 #include "ui/aura/mus/window_tree_host_mus_delegate.h" 30 #include "ui/aura/mus/window_tree_host_mus_delegate.h"
30 31
31 namespace display { 32 namespace display {
32 class Display; 33 class Display;
33 } 34 }
34 35
35 namespace gfx { 36 namespace gfx {
36 class Insets; 37 class Insets;
(...skipping 30 matching lines...) Expand all
67 // WindowTreeClient is owned by the creator. Generally when the delegate gets 68 // WindowTreeClient is owned by the creator. Generally when the delegate gets
68 // one of OnEmbedRootDestroyed() or OnLostConnection() it should delete the 69 // one of OnEmbedRootDestroyed() or OnLostConnection() it should delete the
69 // WindowTreeClient. 70 // WindowTreeClient.
70 // 71 //
71 // When WindowTreeClient is deleted all windows are deleted (and observers 72 // When WindowTreeClient is deleted all windows are deleted (and observers
72 // notified). 73 // notified).
73 class AURA_EXPORT WindowTreeClient 74 class AURA_EXPORT WindowTreeClient
74 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), 75 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient),
75 NON_EXPORTED_BASE(public ui::mojom::WindowManager), 76 NON_EXPORTED_BASE(public ui::mojom::WindowManager),
76 public WindowManagerClient, 77 public WindowManagerClient,
78 public WindowTreeHostMusDelegate,
77 public client::CaptureClientObserver, 79 public client::CaptureClientObserver,
78 public client::FocusChangeObserver, 80 public client::FocusChangeObserver,
79 public WindowTreeHostMusDelegate { 81 public client::TransientWindowClientObserver {
80 public: 82 public:
81 explicit WindowTreeClient( 83 explicit WindowTreeClient(
82 WindowTreeClientDelegate* delegate, 84 WindowTreeClientDelegate* delegate,
83 WindowManagerDelegate* window_manager_delegate = nullptr, 85 WindowManagerDelegate* window_manager_delegate = nullptr,
84 ui::mojom::WindowTreeClientRequest request = nullptr); 86 ui::mojom::WindowTreeClientRequest request = nullptr);
85 ~WindowTreeClient() override; 87 ~WindowTreeClient() override;
86 88
87 // Establishes the connection by way of the WindowTreeFactory. 89 // Establishes the connection by way of the WindowTreeFactory.
88 void ConnectViaWindowTreeFactory(service_manager::Connector* connector); 90 void ConnectViaWindowTreeFactory(service_manager::Connector* connector);
89 91
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 436
435 // Overriden from client::FocusChangeObserver: 437 // Overriden from client::FocusChangeObserver:
436 void OnWindowFocused(Window* gained_focus, Window* lost_focus) override; 438 void OnWindowFocused(Window* gained_focus, Window* lost_focus) override;
437 439
438 // Overriden from client::CaptureClientObserver: 440 // Overriden from client::CaptureClientObserver:
439 void OnCaptureChanged(Window* lost_capture, Window* gained_capture) override; 441 void OnCaptureChanged(Window* lost_capture, Window* gained_capture) override;
440 442
441 // Overriden from WindowTreeHostMusDelegate: 443 // Overriden from WindowTreeHostMusDelegate:
442 void SetRootWindowBounds(Window* window, gfx::Rect* bounds) override; 444 void SetRootWindowBounds(Window* window, gfx::Rect* bounds) override;
443 445
446 // Override from client::TransientWindowClientObserver:
447 void OnTransientChildWindowAdded(Window* parent,
448 Window* transient_child) override;
449 void OnTransientChildWindowRemoved(Window* parent,
450 Window* transient_child) override;
451
444 // The one int in |cursor_location_mapping_|. When we read from this 452 // The one int in |cursor_location_mapping_|. When we read from this
445 // location, we must always read from it atomically. 453 // location, we must always read from it atomically.
446 base::subtle::Atomic32* cursor_location_memory() { 454 base::subtle::Atomic32* cursor_location_memory() {
447 return reinterpret_cast<base::subtle::Atomic32*>( 455 return reinterpret_cast<base::subtle::Atomic32*>(
448 cursor_location_mapping_.get()); 456 cursor_location_mapping_.get());
449 } 457 }
450 458
451 // This is set once and only once when we get OnEmbed(). It gives the unique 459 // This is set once and only once when we get OnEmbed(). It gives the unique
452 // id for this client. 460 // id for this client.
453 ClientSpecificId client_id_; 461 ClientSpecificId client_id_;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 std::set<Id> drag_entered_windows_; 532 std::set<Id> drag_entered_windows_;
525 533
526 base::WeakPtrFactory<WindowTreeClient> weak_factory_; 534 base::WeakPtrFactory<WindowTreeClient> weak_factory_;
527 535
528 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); 536 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient);
529 }; 537 };
530 538
531 } // namespace aura 539 } // namespace aura
532 540
533 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ 541 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698