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

Side by Side Diff: ash/mus/bridge/wm_window_mus.cc

Issue 2620913003: Removes WmRootWindowController subclasses (Closed)
Patch Set: spelling Created 3 years, 11 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 | « ash/mus/bridge/wm_window_mus.h ('k') | ash/mus/root_window_controller.h » ('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 #include "ash/mus/bridge/wm_window_mus.h" 5 #include "ash/mus/bridge/wm_window_mus.h"
6 6
7 #include "ash/common/shelf/shelf_item_types.h" 7 #include "ash/common/shelf/shelf_item_types.h"
8 #include "ash/common/wm/container_finder.h" 8 #include "ash/common/wm/container_finder.h"
9 #include "ash/common/wm/window_positioning_utils.h" 9 #include "ash/common/wm/window_positioning_utils.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
11 #include "ash/common/wm_layout_manager.h" 11 #include "ash/common/wm_layout_manager.h"
12 #include "ash/common/wm_lookup.h" 12 #include "ash/common/wm_lookup.h"
13 #include "ash/common/wm_transient_window_observer.h" 13 #include "ash/common/wm_transient_window_observer.h"
14 #include "ash/common/wm_window_observer.h" 14 #include "ash/common/wm_window_observer.h"
15 #include "ash/common/wm_window_property.h" 15 #include "ash/common/wm_window_property.h"
16 #include "ash/mus/bridge/wm_root_window_controller_mus.h"
17 #include "ash/mus/bridge/wm_shell_mus.h" 16 #include "ash/mus/bridge/wm_shell_mus.h"
18 #include "ash/mus/property_util.h" 17 #include "ash/mus/property_util.h"
18 #include "ash/mus/root_window_controller.h"
19 #include "ash/mus/window_manager.h" 19 #include "ash/mus/window_manager.h"
20 #include "ash/public/cpp/shell_window_ids.h" 20 #include "ash/public/cpp/shell_window_ids.h"
21 #include "ash/wm/window_properties.h" 21 #include "ash/wm/window_properties.h"
22 #include "services/ui/public/interfaces/window_manager.mojom.h" 22 #include "services/ui/public/interfaces/window_manager.mojom.h"
23 #include "ui/aura/client/aura_constants.h" 23 #include "ui/aura/client/aura_constants.h"
24 #include "ui/aura/mus/window_manager_delegate.h" 24 #include "ui/aura/mus/window_manager_delegate.h"
25 #include "ui/aura/mus/window_mus.h" 25 #include "ui/aura/mus/window_mus.h"
26 #include "ui/aura/mus/window_tree_client.h" 26 #include "ui/aura/mus/window_tree_client.h"
27 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
28 #include "ui/base/hit_test.h" 28 #include "ui/base/hit_test.h"
(...skipping 21 matching lines...) Expand all
50 // WmWindowMus is owned by the aura::Window. 50 // WmWindowMus is owned by the aura::Window.
51 // Unfortunately there isn't a good way to avoid the cast here. 51 // Unfortunately there isn't a good way to avoid the cast here.
52 return new WmWindowMus(const_cast<aura::Window*>(window)); 52 return new WmWindowMus(const_cast<aura::Window*>(window));
53 } 53 }
54 54
55 // static 55 // static
56 WmWindowMus* WmWindowMus::Get(views::Widget* widget) { 56 WmWindowMus* WmWindowMus::Get(views::Widget* widget) {
57 return WmWindowMus::Get(widget->GetNativeView()); 57 return WmWindowMus::Get(widget->GetNativeView());
58 } 58 }
59 59
60 const WmRootWindowControllerMus* WmWindowMus::GetRootWindowControllerMus()
61 const {
62 return WmRootWindowControllerMus::Get(aura_window()->GetRootWindow());
63 }
64
65 bool WmWindowMus::IsContainer() const { 60 bool WmWindowMus::IsContainer() const {
66 return GetShellWindowId() != kShellWindowId_Invalid; 61 return GetShellWindowId() != kShellWindowId_Invalid;
67 } 62 }
68 63
69 WmRootWindowController* WmWindowMus::GetRootWindowController() {
70 return GetRootWindowControllerMus();
71 }
72
73 WmShell* WmWindowMus::GetShell() const { 64 WmShell* WmWindowMus::GetShell() const {
74 return WmShellMus::Get(); 65 return WmShellMus::Get();
75 } 66 }
76 67
77 void WmWindowMus::CloseWidget() { 68 void WmWindowMus::CloseWidget() {
78 // NOTE: in the FOR_CLIENT case there is not necessarily a widget associated 69 // NOTE: in the FOR_CLIENT case there is not necessarily a widget associated
79 // with the window. Mash only creates widgets for top level windows if mash 70 // with the window. Mash only creates widgets for top level windows if mash
80 // renders the non-client frame. 71 // renders the non-client frame.
81 if (aura_window()->GetProperty(kWidgetCreationTypeKey) == 72 if (aura_window()->GetProperty(kWidgetCreationTypeKey) ==
82 WidgetCreationType::FOR_CLIENT) { 73 WidgetCreationType::FOR_CLIENT) {
83 WmShellMus::Get()->window_manager()->window_manager_client()->RequestClose( 74 WmShellMus::Get()->window_manager()->window_manager_client()->RequestClose(
84 aura_window()); 75 aura_window());
85 } else { 76 } else {
86 WmWindowAura::CloseWidget(); 77 WmWindowAura::CloseWidget();
87 } 78 }
88 } 79 }
89 80
90 void WmWindowMus::AddLimitedPreTargetHandler(ui::EventHandler* handler) { 81 void WmWindowMus::AddLimitedPreTargetHandler(ui::EventHandler* handler) {
91 DCHECK(WmShellMus::Get()->window_tree_client()->WasCreatedByThisClient( 82 DCHECK(WmShellMus::Get()->window_tree_client()->WasCreatedByThisClient(
92 aura::WindowMus::Get(aura_window()))); 83 aura::WindowMus::Get(aura_window())));
93 WmWindowAura::AddLimitedPreTargetHandler(handler); 84 WmWindowAura::AddLimitedPreTargetHandler(handler);
94 } 85 }
95 86
96 } // namespace mus 87 } // namespace mus
97 } // namespace ash 88 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_window_mus.h ('k') | ash/mus/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698