| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 void NativeWidgetMus::OnActivationChanged(bool active) { | 318 void NativeWidgetMus::OnActivationChanged(bool active) { |
| 319 if (!native_widget_delegate_) | 319 if (!native_widget_delegate_) |
| 320 return; | 320 return; |
| 321 if (active) { | 321 if (active) { |
| 322 native_widget_delegate_->OnNativeFocus(); | 322 native_widget_delegate_->OnNativeFocus(); |
| 323 GetWidget()->GetFocusManager()->RestoreFocusedView(); | 323 GetWidget()->GetFocusManager()->RestoreFocusedView(); |
| 324 } else { | 324 } else { |
| 325 native_widget_delegate_->OnNativeBlur(); | 325 native_widget_delegate_->OnNativeBlur(); |
| 326 GetWidget()->GetFocusManager()->StoreFocusedView(true); | 326 GetWidget()->GetFocusManager()->StoreFocusedView(true); |
| 327 } | 327 } |
| 328 native_widget_delegate_->OnNativeWidgetActivationChanged(active); |
| 328 } | 329 } |
| 329 | 330 |
| 330 void NativeWidgetMus::UpdateClientArea() { | 331 void NativeWidgetMus::UpdateClientArea() { |
| 331 NonClientView* non_client_view = | 332 NonClientView* non_client_view = |
| 332 native_widget_delegate_->AsWidget()->non_client_view(); | 333 native_widget_delegate_->AsWidget()->non_client_view(); |
| 333 if (!non_client_view || !non_client_view->client_view()) | 334 if (!non_client_view || !non_client_view->client_view()) |
| 334 return; | 335 return; |
| 335 | 336 |
| 336 const gfx::Rect client_area_rect(non_client_view->client_view()->bounds()); | 337 const gfx::Rect client_area_rect(non_client_view->client_view()->bounds()); |
| 337 window_->SetClientArea(gfx::Insets( | 338 window_->SetClientArea(gfx::Insets( |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 window_tree_host_->Show(); | 999 window_tree_host_->Show(); |
| 999 GetNativeWindow()->Show(); | 1000 GetNativeWindow()->Show(); |
| 1000 } else { | 1001 } else { |
| 1001 window_tree_host_->Hide(); | 1002 window_tree_host_->Hide(); |
| 1002 GetNativeWindow()->Hide(); | 1003 GetNativeWindow()->Hide(); |
| 1003 } | 1004 } |
| 1004 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1005 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1005 } | 1006 } |
| 1006 | 1007 |
| 1007 } // namespace views | 1008 } // namespace views |
| OLD | NEW |