| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 //////////////////////////////////////////////////////////////////////////////// | 343 //////////////////////////////////////////////////////////////////////////////// |
| 344 // NativeWidgetMus, private: | 344 // NativeWidgetMus, private: |
| 345 | 345 |
| 346 // static | 346 // static |
| 347 void NativeWidgetMus::ConfigurePropertiesForNewWindow( | 347 void NativeWidgetMus::ConfigurePropertiesForNewWindow( |
| 348 const Widget::InitParams& init_params, | 348 const Widget::InitParams& init_params, |
| 349 std::map<std::string, std::vector<uint8_t>>* properties) { | 349 std::map<std::string, std::vector<uint8_t>>* properties) { |
| 350 if (!init_params.bounds.IsEmpty()) { | 350 if (!init_params.bounds.IsEmpty()) { |
| 351 (*properties)[mus::mojom::WindowManager::kUserSetBounds_Property] = | 351 (*properties)[mus::mojom::WindowManager::kUserSetBounds_Property] = |
| 352 mojo::TypeConverter<const std::vector<uint8_t>, gfx::Rect>::Convert( | 352 mojo::ConvertTo<std::vector<uint8_t>>(init_params.bounds); |
| 353 init_params.bounds); | |
| 354 } | 353 } |
| 355 | 354 |
| 356 if (!Widget::RequiresNonClientView(init_params.type)) | 355 if (!Widget::RequiresNonClientView(init_params.type)) |
| 357 return; | 356 return; |
| 358 | 357 |
| 359 (*properties)[mus::mojom::WindowManager::kWindowType_Property] = | 358 (*properties)[mus::mojom::WindowManager::kWindowType_Property] = |
| 360 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( | 359 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>( |
| 361 static_cast<int32_t>( | 360 mojo::ConvertTo<mus::mojom::WindowType>(init_params.type))); |
| 362 mojo::ConvertTo<mus::mojom::WindowType>(init_params.type))); | |
| 363 (*properties)[mus::mojom::WindowManager::kResizeBehavior_Property] = | 361 (*properties)[mus::mojom::WindowManager::kResizeBehavior_Property] = |
| 364 mojo::TypeConverter<const std::vector<uint8_t>, int32_t>::Convert( | 362 mojo::ConvertTo<std::vector<uint8_t>>( |
| 365 ResizeBehaviorFromDelegate(init_params.delegate)); | 363 ResizeBehaviorFromDelegate(init_params.delegate)); |
| 366 SkBitmap app_icon = AppIconFromDelegate(init_params.delegate); | 364 SkBitmap app_icon = AppIconFromDelegate(init_params.delegate); |
| 367 if (!app_icon.isNull()) { | 365 if (!app_icon.isNull()) { |
| 368 (*properties)[mus::mojom::WindowManager::kWindowAppIcon_Property] = | 366 (*properties)[mus::mojom::WindowManager::kWindowAppIcon_Property] = |
| 369 mojo::TypeConverter<const std::vector<uint8_t>, SkBitmap>::Convert( | 367 mojo::ConvertTo<std::vector<uint8_t>>(app_icon); |
| 370 app_icon); | |
| 371 } | 368 } |
| 372 } | 369 } |
| 373 | 370 |
| 374 //////////////////////////////////////////////////////////////////////////////// | 371 //////////////////////////////////////////////////////////////////////////////// |
| 375 // NativeWidgetMus, internal::NativeWidgetPrivate implementation: | 372 // NativeWidgetMus, internal::NativeWidgetPrivate implementation: |
| 376 | 373 |
| 377 NonClientFrameView* NativeWidgetMus::CreateNonClientFrameView() { | 374 NonClientFrameView* NativeWidgetMus::CreateNonClientFrameView() { |
| 378 return new ClientSideNonClientFrameView(GetWidget()); | 375 return new ClientSideNonClientFrameView(GetWidget()); |
| 379 } | 376 } |
| 380 | 377 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 window_tree_host_->Show(); | 1002 window_tree_host_->Show(); |
| 1006 GetNativeWindow()->Show(); | 1003 GetNativeWindow()->Show(); |
| 1007 } else { | 1004 } else { |
| 1008 window_tree_host_->Hide(); | 1005 window_tree_host_->Hide(); |
| 1009 GetNativeWindow()->Hide(); | 1006 GetNativeWindow()->Hide(); |
| 1010 } | 1007 } |
| 1011 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); | 1008 native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible()); |
| 1012 } | 1009 } |
| 1013 | 1010 |
| 1014 } // namespace views | 1011 } // namespace views |
| OLD | NEW |