| 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/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_item_delegate.h" | 10 #include "ash/shelf/shelf_item_delegate.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 observer_ptr->OnAlignmentChanged( | 279 observer_ptr->OnAlignmentChanged( |
| 280 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment())); | 280 static_cast<mash::shelf::mojom::Alignment>(shelf->alignment())); |
| 281 observer_ptr->OnAutoHideBehaviorChanged( | 281 observer_ptr->OnAutoHideBehaviorChanged( |
| 282 static_cast<mash::shelf::mojom::AutoHideBehavior>( | 282 static_cast<mash::shelf::mojom::AutoHideBehavior>( |
| 283 shelf->auto_hide_behavior())); | 283 shelf->auto_hide_behavior())); |
| 284 observers_.AddPtr(std::move(observer_ptr)); | 284 observers_.AddPtr(std::move(observer_ptr)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void ShelfDelegateMus::SetAlignment(mash::shelf::mojom::Alignment alignment) { | 287 void ShelfDelegateMus::SetAlignment(mash::shelf::mojom::Alignment alignment) { |
| 288 wm::ShelfAlignment value = static_cast<wm::ShelfAlignment>(alignment); | 288 wm::ShelfAlignment value = static_cast<wm::ShelfAlignment>(alignment); |
| 289 Shell::GetInstance()->SetShelfAlignment(value, Shell::GetPrimaryRootWindow()); | 289 Shelf::ForPrimaryDisplay()->SetAlignment(value); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void ShelfDelegateMus::SetAutoHideBehavior( | 292 void ShelfDelegateMus::SetAutoHideBehavior( |
| 293 mash::shelf::mojom::AutoHideBehavior auto_hide) { | 293 mash::shelf::mojom::AutoHideBehavior auto_hide) { |
| 294 ShelfAutoHideBehavior value = static_cast<ShelfAutoHideBehavior>(auto_hide); | 294 ShelfAutoHideBehavior value = static_cast<ShelfAutoHideBehavior>(auto_hide); |
| 295 Shell::GetInstance()->SetShelfAutoHideBehavior(value, | 295 Shelf::ForPrimaryDisplay()->SetAutoHideBehavior(value); |
| 296 Shell::GetPrimaryRootWindow()); | |
| 297 } | 296 } |
| 298 | 297 |
| 299 void ShelfDelegateMus::PinItem( | 298 void ShelfDelegateMus::PinItem( |
| 300 mash::shelf::mojom::ShelfItemPtr item, | 299 mash::shelf::mojom::ShelfItemPtr item, |
| 301 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { | 300 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { |
| 302 std::string app_id(item->app_id.To<std::string>()); | 301 std::string app_id(item->app_id.To<std::string>()); |
| 303 if (app_id_to_shelf_id_.count(app_id)) { | 302 if (app_id_to_shelf_id_.count(app_id)) { |
| 304 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | 303 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; |
| 305 ShelfItemDelegateMus* item_delegate = GetShelfItemDelegate(shelf_id); | 304 ShelfItemDelegateMus* item_delegate = GetShelfItemDelegate(shelf_id); |
| 306 item_delegate->SetDelegate(std::move(delegate)); | 305 item_delegate->SetDelegate(std::move(delegate)); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 StatusAreaWidget* status_widget = widget->status_area_widget(); | 473 StatusAreaWidget* status_widget = widget->status_area_widget(); |
| 475 mus::Window* status_window = | 474 mus::Window* status_window = |
| 476 aura::GetMusWindow(status_widget->GetNativeWindow()); | 475 aura::GetMusWindow(status_widget->GetNativeWindow()); |
| 477 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); | 476 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); |
| 478 status_window->SetSharedProperty<gfx::Size>( | 477 status_window->SetSharedProperty<gfx::Size>( |
| 479 mus::mojom::WindowManager::kPreferredSize_Property, status_size); | 478 mus::mojom::WindowManager::kPreferredSize_Property, status_size); |
| 480 } | 479 } |
| 481 | 480 |
| 482 } // namespace sysui | 481 } // namespace sysui |
| 483 } // namespace ash | 482 } // namespace ash |
| OLD | NEW |