Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: ash/sysui/shelf_delegate_mus.cc

Issue 2036353002: mash: Move ash/common/wm/shelf to ash/common/shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/sysui/context_menu_mus.cc ('k') | ash/test/shelf_view_test_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 StatusAreaWidget* status_widget = widget->status_area_widget(); 472 StatusAreaWidget* status_widget = widget->status_area_widget();
473 mus::Window* status_window = 473 mus::Window* status_window =
474 aura::GetMusWindow(status_widget->GetNativeWindow()); 474 aura::GetMusWindow(status_widget->GetNativeWindow());
475 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); 475 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size();
476 status_window->SetSharedProperty<gfx::Size>( 476 status_window->SetSharedProperty<gfx::Size>(
477 mus::mojom::WindowManager::kPreferredSize_Property, status_size); 477 mus::mojom::WindowManager::kPreferredSize_Property, status_size);
478 } 478 }
479 479
480 } // namespace sysui 480 } // namespace sysui
481 } // namespace ash 481 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sysui/context_menu_mus.cc ('k') | ash/test/shelf_view_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698