| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus_client.h" | 5 #include "ui/views/mus/mus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "services/service_manager/public/cpp/connection.h" | 9 #include "services/service_manager/public/cpp/connection.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 static_cast<PrimitiveType>(init_params.keep_on_top)); | 108 static_cast<PrimitiveType>(init_params.keep_on_top)); |
| 109 | 109 |
| 110 if (!Widget::RequiresNonClientView(init_params.type)) | 110 if (!Widget::RequiresNonClientView(init_params.type)) |
| 111 return properties; | 111 return properties; |
| 112 | 112 |
| 113 if (init_params.delegate) { | 113 if (init_params.delegate) { |
| 114 if (properties.count(ui::mojom::WindowManager::kResizeBehavior_Property) == | 114 if (properties.count(ui::mojom::WindowManager::kResizeBehavior_Property) == |
| 115 0) { | 115 0) { |
| 116 properties[ui::mojom::WindowManager::kResizeBehavior_Property] = | 116 properties[ui::mojom::WindowManager::kResizeBehavior_Property] = |
| 117 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<PrimitiveType>( | 117 mojo::ConvertTo<std::vector<uint8_t>>(static_cast<PrimitiveType>( |
| 118 DesktopWindowTreeHostMus::GetResizeBehaviorFromDelegate( | 118 init_params.delegate->GetResizeBehavior())); |
| 119 init_params.delegate))); | |
| 120 } | 119 } |
| 121 | 120 |
| 122 // TODO(crbug.com/667566): Support additional scales or gfx::Image[Skia]. | 121 // TODO(crbug.com/667566): Support additional scales or gfx::Image[Skia]. |
| 123 gfx::ImageSkia app_icon = init_params.delegate->GetWindowAppIcon(); | 122 gfx::ImageSkia app_icon = init_params.delegate->GetWindowAppIcon(); |
| 124 SkBitmap app_bitmap = app_icon.GetRepresentation(1.f).sk_bitmap(); | 123 SkBitmap app_bitmap = app_icon.GetRepresentation(1.f).sk_bitmap(); |
| 125 if (!app_bitmap.isNull()) { | 124 if (!app_bitmap.isNull()) { |
| 126 properties[ui::mojom::WindowManager::kAppIcon_Property] = | 125 properties[ui::mojom::WindowManager::kAppIcon_Property] = |
| 127 mojo::ConvertTo<std::vector<uint8_t>>(app_bitmap); | 126 mojo::ConvertTo<std::vector<uint8_t>>(app_bitmap); |
| 128 } | 127 } |
| 129 // TODO(crbug.com/667566): Support additional scales or gfx::Image[Skia]. | 128 // TODO(crbug.com/667566): Support additional scales or gfx::Image[Skia]. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 return root->GetTopWindowContainingPoint(relative_point); | 252 return root->GetTopWindowContainingPoint(relative_point); |
| 254 } | 253 } |
| 255 return nullptr; | 254 return nullptr; |
| 256 } | 255 } |
| 257 | 256 |
| 258 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { | 257 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { |
| 259 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 258 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 260 } | 259 } |
| 261 | 260 |
| 262 } // namespace views | 261 } // namespace views |
| OLD | NEW |