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

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

Issue 2488723002: Reland of Improves focus/activation for aura-mus and DesktopNativeWidgetAura (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
« 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/window_tree_host_mus.h" 13 #include "ui/aura/mus/window_tree_host_mus.h"
13 #include "ui/views/mus/mus_export.h" 14 #include "ui/views/mus/mus_export.h"
14 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" 15 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
15 16
16 namespace views { 17 namespace views {
17 18
18 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus 19 class VIEWS_MUS_EXPORT DesktopWindowTreeHostMus
19 : public DesktopWindowTreeHost, 20 : public DesktopWindowTreeHost,
20 public aura::WindowTreeHostMus { 21 public aura::WindowTreeHostMus,
22 public aura::EnvObserver {
21 public: 23 public:
22 DesktopWindowTreeHostMus( 24 DesktopWindowTreeHostMus(
23 internal::NativeWidgetDelegate* native_widget_delegate, 25 internal::NativeWidgetDelegate* native_widget_delegate,
24 DesktopNativeWidgetAura* desktop_native_widget_aura); 26 DesktopNativeWidgetAura* desktop_native_widget_aura);
25 ~DesktopWindowTreeHostMus() override; 27 ~DesktopWindowTreeHostMus() override;
26 28
27 private: 29 private:
28 bool IsDocked() const; 30 bool IsDocked() const;
29 31
30 // DesktopWindowTreeHost: 32 // DesktopWindowTreeHost:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void SetOpacity(float opacity) override; 83 void SetOpacity(float opacity) override;
82 void SetWindowIcons(const gfx::ImageSkia& window_icon, 84 void SetWindowIcons(const gfx::ImageSkia& window_icon,
83 const gfx::ImageSkia& app_icon) override; 85 const gfx::ImageSkia& app_icon) override;
84 void InitModalType(ui::ModalType modal_type) override; 86 void InitModalType(ui::ModalType modal_type) override;
85 void FlashFrame(bool flash_frame) override; 87 void FlashFrame(bool flash_frame) override;
86 void OnRootViewLayout() override; 88 void OnRootViewLayout() override;
87 bool IsAnimatingClosed() const override; 89 bool IsAnimatingClosed() const override;
88 bool IsTranslucentWindowOpacitySupported() const override; 90 bool IsTranslucentWindowOpacitySupported() const override;
89 void SizeConstraintsChanged() override; 91 void SizeConstraintsChanged() override;
90 92
93 // aura::EnvObserver:
94 void OnWindowInitialized(aura::Window* window) override;
95 void OnActiveFocusClientChanged(aura::client::FocusClient* focus_client,
96 aura::Window* window) override;
97
91 internal::NativeWidgetDelegate* native_widget_delegate_; 98 internal::NativeWidgetDelegate* native_widget_delegate_;
92 99
93 DesktopNativeWidgetAura* desktop_native_widget_aura_; 100 DesktopNativeWidgetAura* desktop_native_widget_aura_;
94 101
95 // State to restore window to when exiting fullscreen. Only valid if 102 // State to restore window to when exiting fullscreen. Only valid if
96 // fullscreen. 103 // fullscreen.
97 ui::WindowShowState fullscreen_restore_state_; 104 ui::WindowShowState fullscreen_restore_state_;
98 105
99 // We can optionally have a parent which can order us to close, or own 106 // We can optionally have a parent which can order us to close, or own
100 // children who we're responsible for closing when we CloseNow(). 107 // children who we're responsible for closing when we CloseNow().
101 DesktopWindowTreeHostMus* parent_ = nullptr; 108 DesktopWindowTreeHostMus* parent_ = nullptr;
102 std::set<DesktopWindowTreeHostMus*> children_; 109 std::set<DesktopWindowTreeHostMus*> children_;
103 110
111 bool is_active_ = false;
112
104 // Used so that Close() isn't immediate. 113 // Used so that Close() isn't immediate.
105 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_; 114 base::WeakPtrFactory<DesktopWindowTreeHostMus> close_widget_factory_;
106 115
107 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus); 116 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMus);
108 }; 117 };
109 118
110 } // namespace views 119 } // namespace views
111 120
112 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_MUS_H_ 121 #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