| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 } | 822 } |
| 823 | 823 |
| 824 bool NativeWidgetMus::IsVisible() const { | 824 bool NativeWidgetMus::IsVisible() const { |
| 825 // TODO(beng): this should probably be wired thru PlatformWindow. | 825 // TODO(beng): this should probably be wired thru PlatformWindow. |
| 826 return window_ && window_->visible(); | 826 return window_ && window_->visible(); |
| 827 } | 827 } |
| 828 | 828 |
| 829 void NativeWidgetMus::Activate() { | 829 void NativeWidgetMus::Activate() { |
| 830 if (window_) | 830 if (window_) |
| 831 window_->SetFocus(); | 831 window_->SetFocus(); |
| 832 static_cast<aura::client::ActivationClient*>(focus_client_.get()) |
| 833 ->ActivateWindow(content_); |
| 832 } | 834 } |
| 833 | 835 |
| 834 void NativeWidgetMus::Deactivate() { | 836 void NativeWidgetMus::Deactivate() { |
| 835 if (IsActive()) | 837 if (IsActive()) |
| 836 window_->connection()->ClearFocus(); | 838 window_->connection()->ClearFocus(); |
| 837 } | 839 } |
| 838 | 840 |
| 839 bool NativeWidgetMus::IsActive() const { | 841 bool NativeWidgetMus::IsActive() const { |
| 840 mus::Window* focused = | 842 mus::Window* focused = |
| 841 window_ ? window_->connection()->GetFocusedWindow() : nullptr; | 843 window_ ? window_->connection()->GetFocusedWindow() : nullptr; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 GetNativeWindow()->Show(); | 1156 GetNativeWindow()->Show(); |
| 1155 } else { | 1157 } else { |
| 1156 window_tree_host_->Hide(); | 1158 window_tree_host_->Hide(); |
| 1157 window_->SetVisible(false); | 1159 window_->SetVisible(false); |
| 1158 GetNativeWindow()->Hide(); | 1160 GetNativeWindow()->Hide(); |
| 1159 } | 1161 } |
| 1160 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1162 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1161 } | 1163 } |
| 1162 | 1164 |
| 1163 } // namespace views | 1165 } // namespace views |
| OLD | NEW |