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

Side by Side Diff: ui/views/mus/desktop_window_tree_host_mus.h

Issue 2714763002: Change FocusSynchronizer to maintain active focus client and window. (Closed)
Patch Set: test Created 3 years, 8 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 | « ui/aura/test/aura_test_helper.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/aura/env_observer.h" 12 #include "ui/aura/mus/focus_synchronizer_observer.h"
13 #include "ui/aura/mus/window_tree_host_mus.h" 13 #include "ui/aura/mus/window_tree_host_mus.h"
14 #include "ui/aura/window_observer.h" 14 #include "ui/aura/window_observer.h"
15 #include "ui/views/mus/mus_client_observer.h" 15 #include "ui/views/mus/mus_client_observer.h"
16 #include "ui/views/mus/mus_export.h" 16 #include "ui/views/mus/mus_export.h"
17 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" 17 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
18 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
19 #include "ui/views/widget/widget_observer.h" 19 #include "ui/views/widget/widget_observer.h"
20 20
21 namespace wm { 21 namespace wm {
22 class CursorManager; 22 class CursorManager;
23 } 23 }
24 24
25 namespace views { 25 namespace views {
26 26
27 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus 27 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus
28 : public DesktopWindowTreeHost, 28 : public DesktopWindowTreeHost,
29 public MusClientObserver, 29 public MusClientObserver,
30 public WidgetObserver, 30 public WidgetObserver,
31 public aura::FocusSynchronizerObserver,
31 public aura::WindowObserver, 32 public aura::WindowObserver,
32 public aura::WindowTreeHostMus, 33 public aura::WindowTreeHostMus {
33 public aura::EnvObserver {
34 public: 34 public:
35 DesktopWindowTreeHostMus( 35 DesktopWindowTreeHostMus(
36 internal::NativeWidgetDelegate* native_widget_delegate, 36 internal::NativeWidgetDelegate* native_widget_delegate,
37 DesktopNativeWidgetAura* desktop_native_widget_aura, 37 DesktopNativeWidgetAura* desktop_native_widget_aura,
38 const cc::FrameSinkId& frame_sink_id, 38 const cc::FrameSinkId& frame_sink_id,
39 const std::map<std::string, std::vector<uint8_t>>* mus_properties); 39 const std::map<std::string, std::vector<uint8_t>>* mus_properties);
40 ~DesktopWindowTreeHostMus() override; 40 ~DesktopWindowTreeHostMus() override;
41 41
42 // Called when the window was deleted on the server. 42 // Called when the window was deleted on the server.
43 void ServerDestroyedWindow() { CloseNow(); } 43 void ServerDestroyedWindow() { CloseNow(); }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 bool ShouldUpdateWindowTransparency() const override; 124 bool ShouldUpdateWindowTransparency() const override;
125 bool ShouldUseDesktopNativeCursorManager() const override; 125 bool ShouldUseDesktopNativeCursorManager() const override;
126 bool ShouldCreateVisibilityController() const override; 126 bool ShouldCreateVisibilityController() const override;
127 127
128 // MusClientObserver: 128 // MusClientObserver:
129 void OnWindowManagerFrameValuesChanged() override; 129 void OnWindowManagerFrameValuesChanged() override;
130 130
131 // WidgetObserver: 131 // WidgetObserver:
132 void OnWidgetActivationChanged(Widget* widget, bool active) override; 132 void OnWidgetActivationChanged(Widget* widget, bool active) override;
133 133
134 // aura::FocusSynchronizerObserver:
135 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client,
136 aura::Window* focus_client_root) override;
137
134 // aura::WindowObserver: 138 // aura::WindowObserver:
135 void OnWindowPropertyChanged(aura::Window* window, 139 void OnWindowPropertyChanged(aura::Window* window,
136 const void* key, 140 const void* key,
137 intptr_t old) override; 141 intptr_t old) override;
138 142
139 // aura::WindowTreeHostMus: 143 // aura::WindowTreeHostMus:
140 void ShowImpl() override; 144 void ShowImpl() override;
141 void HideImpl() override; 145 void HideImpl() override;
142 void SetBoundsInPixels(const gfx::Rect& bounds_in_pixels) override; 146 void SetBoundsInPixels(const gfx::Rect& bounds_in_pixels) override;
143 147
144 // aura::EnvObserver:
145 void OnWindowInitialized(aura::Window* window) override;
146 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client,
147 aura::Window* window) override;
148
149 internal::NativeWidgetDelegate* native_widget_delegate_; 148 internal::NativeWidgetDelegate* native_widget_delegate_;
150 149
151 DesktopNativeWidgetAura* desktop_native_widget_aura_; 150 DesktopNativeWidgetAura* desktop_native_widget_aura_;
152 151
153 // We can optionally have a parent which can order us to close, or own 152 // We can optionally have a parent which can order us to close, or own
154 // children who we're responsible for closing when we CloseNow(). 153 // children who we're responsible for closing when we CloseNow().
155 DesktopWindowTreeHostMus* parent_ = nullptr; 154 DesktopWindowTreeHostMus* parent_ = nullptr;
156 std::set<DesktopWindowTreeHostMus*> children_; 155 std::set<DesktopWindowTreeHostMus*> children_;
157 156
158 bool is_active_ = false; 157 bool is_active_ = false;
159 158
160 std::unique_ptr<wm::CursorManager> cursor_manager_; 159 std::unique_ptr<wm::CursorManager> cursor_manager_;
161 160
162 bool auto_update_client_area_ = true; 161 bool auto_update_client_area_ = true;
163 162
164 // Used so that Close() isn't immediate. 163 // Used so that Close() isn't immediate.
165 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; 164 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_;
166 165
167 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); 166 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus);
168 }; 167 };
169 168
170 } // namespace views 169 } // namespace views
171 170
172 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ 171 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.cc ('k') | ui/views/mus/desktop_window_tree_host_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698