| 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/thread_task_runner_handle.h" | 8 #include "base/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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 const gfx::Rect& restored_bounds) { | 702 const gfx::Rect& restored_bounds) { |
| 703 // NOTIMPLEMENTED(); | 703 // NOTIMPLEMENTED(); |
| 704 } | 704 } |
| 705 | 705 |
| 706 void NativeWidgetMus::ShowWithWindowState(ui::WindowShowState state) { | 706 void NativeWidgetMus::ShowWithWindowState(ui::WindowShowState state) { |
| 707 if (!window_tree_host_) | 707 if (!window_tree_host_) |
| 708 return; | 708 return; |
| 709 | 709 |
| 710 window_tree_host_->Show(); | 710 window_tree_host_->Show(); |
| 711 GetNativeWindow()->Show(); | 711 GetNativeWindow()->Show(); |
| 712 if (state != ui::SHOW_STATE_INACTIVE) | 712 if (native_widget_delegate_->CanActivate()) { |
| 713 Activate(); | 713 if (state != ui::SHOW_STATE_INACTIVE) |
| 714 GetWidget()->SetInitialFocus(state); | 714 Activate(); |
| 715 GetWidget()->SetInitialFocus(state); |
| 716 } |
| 715 } | 717 } |
| 716 | 718 |
| 717 bool NativeWidgetMus::IsVisible() const { | 719 bool NativeWidgetMus::IsVisible() const { |
| 718 // TODO(beng): this should probably be wired thru PlatformWindow. | 720 // TODO(beng): this should probably be wired thru PlatformWindow. |
| 719 return window_ && window_->visible(); | 721 return window_ && window_->visible(); |
| 720 } | 722 } |
| 721 | 723 |
| 722 void NativeWidgetMus::Activate() { | 724 void NativeWidgetMus::Activate() { |
| 723 if (window_tree_host_) | 725 if (window_tree_host_) |
| 724 window_tree_host_->platform_window()->Activate(); | 726 window_tree_host_->platform_window()->Activate(); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 window_tree_host_->Show(); | 1047 window_tree_host_->Show(); |
| 1046 GetNativeWindow()->Show(); | 1048 GetNativeWindow()->Show(); |
| 1047 } else { | 1049 } else { |
| 1048 window_tree_host_->Hide(); | 1050 window_tree_host_->Hide(); |
| 1049 GetNativeWindow()->Hide(); | 1051 GetNativeWindow()->Hide(); |
| 1050 } | 1052 } |
| 1051 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1053 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1052 } | 1054 } |
| 1053 | 1055 |
| 1054 } // namespace views | 1056 } // namespace views |
| OLD | NEW |