| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/views/mus/native_widget_mus.h" | 5 #include "ui/views/mus/native_widget_mus.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "components/mus/public/cpp/property_type_converters.h" | 9 #include "components/mus/public/cpp/property_type_converters.h" |
| 10 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 case mus::mojom::ShowState::DOCKED: | 355 case mus::mojom::ShowState::DOCKED: |
| 356 // TODO(sky): support docked. | 356 // TODO(sky): support docked. |
| 357 state = ui::PLATFORM_WINDOW_STATE_NORMAL; | 357 state = ui::PLATFORM_WINDOW_STATE_NORMAL; |
| 358 break; | 358 break; |
| 359 case mus::mojom::ShowState::FULLSCREEN: | 359 case mus::mojom::ShowState::FULLSCREEN: |
| 360 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN; | 360 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN; |
| 361 break; | 361 break; |
| 362 } | 362 } |
| 363 platform_window_delegate()->OnWindowStateChanged(state); | 363 platform_window_delegate()->OnWindowStateChanged(state); |
| 364 } | 364 } |
| 365 void OnWindowDestroyed(mus::Window* window) override { |
| 366 DCHECK_EQ(mus_window(), window); |
| 367 platform_window_delegate()->OnClosed(); |
| 368 } |
| 369 void OnWindowFocusChanged(mus::Window* gained_focus, |
| 370 mus::Window* lost_focus) override { |
| 371 if (gained_focus == mus_window()) |
| 372 platform_window_delegate()->OnActivationChanged(true); |
| 373 else if (lost_focus == mus_window()) |
| 374 platform_window_delegate()->OnActivationChanged(false); |
| 375 } |
| 376 void OnRequestClose(mus::Window* window) override { |
| 377 platform_window_delegate()->OnCloseRequest(); |
| 378 } |
| 365 | 379 |
| 366 private: | 380 private: |
| 367 mus::Window* mus_window() { return native_widget_mus_->window(); } | 381 mus::Window* mus_window() { return native_widget_mus_->window(); } |
| 368 WindowTreeHostMus* window_tree_host() { | 382 WindowTreeHostMus* window_tree_host() { |
| 369 return native_widget_mus_->window_tree_host(); | 383 return native_widget_mus_->window_tree_host(); |
| 370 } | 384 } |
| 371 ui::PlatformWindowDelegate* platform_window_delegate() { | 385 ui::PlatformWindowDelegate* platform_window_delegate() { |
| 372 return native_widget_mus_->window_tree_host(); | 386 return native_widget_mus_->window_tree_host(); |
| 373 } | 387 } |
| 374 | 388 |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 GetNativeWindow()->Show(); | 1223 GetNativeWindow()->Show(); |
| 1210 } else { | 1224 } else { |
| 1211 window_tree_host_->Hide(); | 1225 window_tree_host_->Hide(); |
| 1212 window_->SetVisible(false); | 1226 window_->SetVisible(false); |
| 1213 GetNativeWindow()->Hide(); | 1227 GetNativeWindow()->Hide(); |
| 1214 } | 1228 } |
| 1215 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1229 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1216 } | 1230 } |
| 1217 | 1231 |
| 1218 } // namespace views | 1232 } // namespace views |
| OLD | NEW |