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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 641 } |
642 (*properties)[ui::mojom::WindowManager::kAlwaysOnTop_Property] = | 642 (*properties)[ui::mojom::WindowManager::kAlwaysOnTop_Property] = |
643 mojo::ConvertTo<std::vector<uint8_t>>(init_params.keep_on_top); | 643 mojo::ConvertTo<std::vector<uint8_t>>(init_params.keep_on_top); |
644 | 644 |
645 if (!Widget::RequiresNonClientView(init_params.type)) | 645 if (!Widget::RequiresNonClientView(init_params.type)) |
646 return; | 646 return; |
647 | 647 |
648 (*properties)[ui::mojom::WindowManager::kWindowType_Property] = | 648 (*properties)[ui::mojom::WindowManager::kWindowType_Property] = |
649 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>( | 649 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<int32_t>( |
650 mojo::ConvertTo<ui::mojom::WindowType>(init_params.type))); | 650 mojo::ConvertTo<ui::mojom::WindowType>(init_params.type))); |
651 (*properties)[ui::mojom::WindowManager::kResizeBehavior_Property] = | 651 if (!init_params.delegate && |
652 mojo::ConvertTo<std::vector<uint8_t>>( | 652 properties->count(ui::mojom::WindowManager::kResizeBehavior_Property) == |
653 ResizeBehaviorFromDelegate(init_params.delegate)); | 653 0) { |
| 654 (*properties)[ui::mojom::WindowManager::kResizeBehavior_Property] = |
| 655 mojo::ConvertTo<std::vector<uint8_t>>( |
| 656 ResizeBehaviorFromDelegate(init_params.delegate)); |
| 657 } |
654 SkBitmap app_icon = AppIconFromDelegate(init_params.delegate); | 658 SkBitmap app_icon = AppIconFromDelegate(init_params.delegate); |
655 if (!app_icon.isNull()) { | 659 if (!app_icon.isNull()) { |
656 (*properties)[ui::mojom::WindowManager::kWindowAppIcon_Property] = | 660 (*properties)[ui::mojom::WindowManager::kWindowAppIcon_Property] = |
657 mojo::ConvertTo<std::vector<uint8_t>>(app_icon); | 661 mojo::ConvertTo<std::vector<uint8_t>>(app_icon); |
658 } | 662 } |
659 } | 663 } |
660 | 664 |
661 //////////////////////////////////////////////////////////////////////////////// | 665 //////////////////////////////////////////////////////////////////////////////// |
662 // NativeWidgetMus, internal::NativeWidgetPrivate implementation: | 666 // NativeWidgetMus, internal::NativeWidgetPrivate implementation: |
663 | 667 |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 | 1421 |
1418 gfx::Path mask_path; | 1422 gfx::Path mask_path; |
1419 native_widget_delegate_->GetHitTestMask(&mask_path); | 1423 native_widget_delegate_->GetHitTestMask(&mask_path); |
1420 // TODO(jamescook): Use the full path for the mask. | 1424 // TODO(jamescook): Use the full path for the mask. |
1421 gfx::Rect mask_rect = | 1425 gfx::Rect mask_rect = |
1422 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); | 1426 gfx::ToEnclosingRect(gfx::SkRectToRectF(mask_path.getBounds())); |
1423 window_->SetHitTestMask(mask_rect); | 1427 window_->SetHitTestMask(mask_rect); |
1424 } | 1428 } |
1425 | 1429 |
1426 } // namespace views | 1430 } // namespace views |
OLD | NEW |