| OLD | NEW |
| 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/wm/container_finder.h" | 7 #include "ash/common/wm/container_finder.h" |
| 8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/common/wm_layout_manager.h" | 9 #include "ash/common/wm_layout_manager.h" |
| 10 #include "ash/common/wm_transient_window_observer.h" | 10 #include "ash/common/wm_transient_window_observer.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 bool WmWindowMus::ShouldUseExtendedHitRegion() const { | 152 bool WmWindowMus::ShouldUseExtendedHitRegion() const { |
| 153 const WmWindowMus* parent = Get(window_->parent()); | 153 const WmWindowMus* parent = Get(window_->parent()); |
| 154 return parent && parent->children_use_extended_hit_region_; | 154 return parent && parent->children_use_extended_hit_region_; |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool WmWindowMus::IsContainer() const { | 157 bool WmWindowMus::IsContainer() const { |
| 158 return GetShellWindowId() != kShellWindowId_Invalid; | 158 return GetShellWindowId() != kShellWindowId_Invalid; |
| 159 } | 159 } |
| 160 | 160 |
| 161 void WmWindowMus::Destroy() { |
| 162 window_->Destroy(); |
| 163 } |
| 164 |
| 161 const WmWindow* WmWindowMus::GetRootWindow() const { | 165 const WmWindow* WmWindowMus::GetRootWindow() const { |
| 162 return Get(window_->GetRoot()); | 166 return Get(window_->GetRoot()); |
| 163 } | 167 } |
| 164 | 168 |
| 165 WmRootWindowController* WmWindowMus::GetRootWindowController() { | 169 WmRootWindowController* WmWindowMus::GetRootWindowController() { |
| 166 return GetRootWindowControllerMus(); | 170 return GetRootWindowControllerMus(); |
| 167 } | 171 } |
| 168 | 172 |
| 169 WmShell* WmWindowMus::GetShell() const { | 173 WmShell* WmWindowMus::GetShell() const { |
| 170 return WmShellMus::Get(); | 174 return WmShellMus::Get(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 192 | 196 |
| 193 void WmWindowMus::SetShellWindowId(int id) { | 197 void WmWindowMus::SetShellWindowId(int id) { |
| 194 shell_window_id_ = id; | 198 shell_window_id_ = id; |
| 195 } | 199 } |
| 196 | 200 |
| 197 int WmWindowMus::GetShellWindowId() const { | 201 int WmWindowMus::GetShellWindowId() const { |
| 198 return shell_window_id_; | 202 return shell_window_id_; |
| 199 } | 203 } |
| 200 | 204 |
| 201 ui::wm::WindowType WmWindowMus::GetType() const { | 205 ui::wm::WindowType WmWindowMus::GetType() const { |
| 202 return GetWmWindowType(window_); | 206 // If the WindowType was expicitly set, then it means |window_| was created |
| 207 // by way of WmShellMus::NewWindow() and the type is locally defined. For |
| 208 // windows created in other ways, say from the client, then we need to get |
| 209 // the type from |window_| directly. |
| 210 return is_wm_window_type_set_ ? wm_window_type_ : GetWmWindowType(window_); |
| 203 } | 211 } |
| 204 | 212 |
| 205 bool WmWindowMus::IsBubble() { | 213 bool WmWindowMus::IsBubble() { |
| 206 return GetWindowType(window_) == ui::mojom::WindowType::BUBBLE; | 214 return GetWindowType(window_) == ui::mojom::WindowType::BUBBLE; |
| 207 } | 215 } |
| 208 | 216 |
| 209 ui::Layer* WmWindowMus::GetLayer() { | 217 ui::Layer* WmWindowMus::GetLayer() { |
| 210 // TODO(sky): this function should be nuked entirely. | 218 // TODO(sky): this function should be nuked entirely. |
| 211 NOTIMPLEMENTED(); | 219 NOTIMPLEMENTED(); |
| 212 return widget_ ? widget_->GetLayer() : nullptr; | 220 return widget_ ? widget_->GetLayer() : nullptr; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } else { | 427 } else { |
| 420 layout_manager_adapter_.reset(); | 428 layout_manager_adapter_.reset(); |
| 421 } | 429 } |
| 422 } | 430 } |
| 423 | 431 |
| 424 WmLayoutManager* WmWindowMus::GetLayoutManager() { | 432 WmLayoutManager* WmWindowMus::GetLayoutManager() { |
| 425 return layout_manager_adapter_ ? layout_manager_adapter_->layout_manager() | 433 return layout_manager_adapter_ ? layout_manager_adapter_->layout_manager() |
| 426 : nullptr; | 434 : nullptr; |
| 427 } | 435 } |
| 428 | 436 |
| 437 void WmWindowMus::SetVisibilityChangesAnimated() { |
| 438 // TODO: need animation support: http://crbug.com/615087. |
| 439 NOTIMPLEMENTED(); |
| 440 } |
| 441 |
| 429 void WmWindowMus::SetVisibilityAnimationType(int type) { | 442 void WmWindowMus::SetVisibilityAnimationType(int type) { |
| 430 // TODO: need animation support: http://crbug.com/615087. | 443 // TODO: need animation support: http://crbug.com/615087. |
| 431 NOTIMPLEMENTED(); | 444 NOTIMPLEMENTED(); |
| 432 } | 445 } |
| 433 | 446 |
| 434 void WmWindowMus::SetVisibilityAnimationDuration(base::TimeDelta delta) { | 447 void WmWindowMus::SetVisibilityAnimationDuration(base::TimeDelta delta) { |
| 435 // TODO: need animation support: http://crbug.com/615087. | 448 // TODO: need animation support: http://crbug.com/615087. |
| 436 NOTIMPLEMENTED(); | 449 NOTIMPLEMENTED(); |
| 437 } | 450 } |
| 438 | 451 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 } | 883 } |
| 871 | 884 |
| 872 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, | 885 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, |
| 873 ui::Window* transient) { | 886 ui::Window* transient) { |
| 874 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 887 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
| 875 OnTransientChildRemoved(this, Get(transient))); | 888 OnTransientChildRemoved(this, Get(transient))); |
| 876 } | 889 } |
| 877 | 890 |
| 878 } // namespace mus | 891 } // namespace mus |
| 879 } // namespace ash | 892 } // namespace ash |
| OLD | NEW |