| 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 "ash/sysui/shelf_delegate_mus.h" | 5 #include "ash/sysui/shelf_delegate_mus.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/common/shelf/shelf_types.h" |
| 9 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_item_delegate.h" | 11 #include "ash/shelf/shelf_item_delegate.h" |
| 11 #include "ash/shelf/shelf_item_delegate_manager.h" | 12 #include "ash/shelf/shelf_item_delegate_manager.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" | 13 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/shelf_menu_model.h" | 14 #include "ash/shelf/shelf_menu_model.h" |
| 14 #include "ash/shelf/shelf_model.h" | 15 #include "ash/shelf/shelf_model.h" |
| 15 #include "ash/shelf/shelf_types.h" | |
| 16 #include "ash/shelf/shelf_widget.h" | 16 #include "ash/shelf/shelf_widget.h" |
| 17 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "components/mus/public/cpp/property_type_converters.h" | 19 #include "components/mus/public/cpp/property_type_converters.h" |
| 20 #include "components/mus/public/cpp/window.h" | 20 #include "components/mus/public/cpp/window.h" |
| 21 #include "components/mus/public/cpp/window_property.h" | 21 #include "components/mus/public/cpp/window_property.h" |
| 22 #include "mojo/common/common_type_converters.h" | 22 #include "mojo/common/common_type_converters.h" |
| 23 #include "services/shell/public/cpp/connector.h" | 23 #include "services/shell/public/cpp/connector.h" |
| 24 #include "ui/aura/mus/mus_util.h" | 24 #include "ui/aura/mus/mus_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 Shelf* shelf = Shelf::ForPrimaryDisplay(); | 277 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
| 278 observer_ptr->OnAlignmentChanged( | 278 observer_ptr->OnAlignmentChanged( |
| 279 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment())); | 279 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment())); |
| 280 observer_ptr->OnAutoHideBehaviorChanged( | 280 observer_ptr->OnAutoHideBehaviorChanged( |
| 281 static_cast<mash::shelf::mojom::AutoHideBehavior>( | 281 static_cast<mash::shelf::mojom::AutoHideBehavior>( |
| 282 shelf->auto_hide_behavior())); | 282 shelf->auto_hide_behavior())); |
| 283 observers_.AddPtr(std::move(observer_ptr)); | 283 observers_.AddPtr(std::move(observer_ptr)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ShelfDelegateMus::SetAlignment(mash::shelf::mojom::Alignment alignment) { | 286 void ShelfDelegateMus::SetAlignment(mash::shelf::mojom::Alignment alignment) { |
| 287 wm::ShelfAlignment value = static_cast<wm::ShelfAlignment>(alignment); | 287 ShelfAlignment value = static_cast<ShelfAlignment>(alignment); |
| 288 Shelf::ForPrimaryDisplay()->SetAlignment(value); | 288 Shelf::ForPrimaryDisplay()->SetAlignment(value); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void ShelfDelegateMus::SetAutoHideBehavior( | 291 void ShelfDelegateMus::SetAutoHideBehavior( |
| 292 mash::shelf::mojom::AutoHideBehavior auto_hide) { | 292 mash::shelf::mojom::AutoHideBehavior auto_hide) { |
| 293 ShelfAutoHideBehavior value = static_cast<ShelfAutoHideBehavior>(auto_hide); | 293 ShelfAutoHideBehavior value = static_cast<ShelfAutoHideBehavior>(auto_hide); |
| 294 Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(value); | 294 Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(value); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void ShelfDelegateMus::PinItem( | 297 void ShelfDelegateMus::PinItem( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 StatusAreaWidget* status_widget = widget->status_area_widget(); | 471 StatusAreaWidget* status_widget = widget->status_area_widget(); |
| 472 mus::Window* status_window = | 472 mus::Window* status_window = |
| 473 aura::GetMusWindow(status_widget->GetNativeWindow()); | 473 aura::GetMusWindow(status_widget->GetNativeWindow()); |
| 474 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); | 474 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); |
| 475 status_window->SetSharedProperty<gfx::Size>( | 475 status_window->SetSharedProperty<gfx::Size>( |
| 476 mus::mojom::WindowManager::kPreferredSize_Property, status_size); | 476 mus::mojom::WindowManager::kPreferredSize_Property, status_size); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace sysui | 479 } // namespace sysui |
| 480 } // namespace ash | 480 } // namespace ash |
| OLD | NEW |