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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 window_tree_host_->Show(); | 1006 window_tree_host_->Show(); |
1006 GetNativeWindow()->Show(); | 1007 GetNativeWindow()->Show(); |
1007 } else { | 1008 } else { |
1008 window_tree_host_->Hide(); | 1009 window_tree_host_->Hide(); |
1009 GetNativeWindow()->Hide(); | 1010 GetNativeWindow()->Hide(); |
1010 } | 1011 } |
1011 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1012 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
1012 } | 1013 } |
1013 | 1014 |
1014 } // namespace views | 1015 } // namespace views |
OLD | NEW |