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

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

Issue 1984433002: Hook up Chrome's wallpaper picker for mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add explicit WallpaperLayout enum conversion functions. 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/shelf_delegate_mus.h ('k') | ash/sysui/shell_delegate_mus.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/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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 return; 345 return;
346 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()]; 346 ShelfID shelf_id = app_id_to_shelf_id_[app_id.To<std::string>()];
347 int index = model_->ItemIndexByID(shelf_id); 347 int index = model_->ItemIndexByID(shelf_id);
348 DCHECK_GE(index, 0); 348 DCHECK_GE(index, 0);
349 ShelfItem item = *model_->ItemByID(shelf_id); 349 ShelfItem item = *model_->ItemByID(shelf_id);
350 item.image = GetShelfIconFromBitmap(image); 350 item.image = GetShelfIconFromBitmap(image);
351 model_->Set(index, item); 351 model_->Set(index, item);
352 } 352 }
353 353
354 void ShelfDelegateMus::OnUserWindowObserverAdded( 354 void ShelfDelegateMus::OnUserWindowObserverAdded(
355 mojo::Array<mojom::UserWindowPtr> user_windows) { 355 mojo::Array<ash::mojom::UserWindowPtr> user_windows) {
356 for (size_t i = 0; i < user_windows.size(); ++i) 356 for (size_t i = 0; i < user_windows.size(); ++i)
357 OnUserWindowAdded(std::move(user_windows[i])); 357 OnUserWindowAdded(std::move(user_windows[i]));
358 } 358 }
359 359
360 void ShelfDelegateMus::OnUserWindowAdded(mojom::UserWindowPtr user_window) { 360 void ShelfDelegateMus::OnUserWindowAdded(
361 ash::mojom::UserWindowPtr user_window) {
361 DCHECK(!window_id_to_shelf_id_.count(user_window->window_id)); 362 DCHECK(!window_id_to_shelf_id_.count(user_window->window_id));
362 363
363 if (user_window->ignored_by_shelf) 364 if (user_window->ignored_by_shelf)
364 return; 365 return;
365 366
366 std::string app_id(user_window->window_app_id.To<std::string>()); 367 std::string app_id(user_window->window_app_id.To<std::string>());
367 if (app_id_to_shelf_id_.count(app_id)) { 368 if (app_id_to_shelf_id_.count(app_id)) {
368 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; 369 ShelfID shelf_id = app_id_to_shelf_id_[app_id];
369 window_id_to_shelf_id_.insert( 370 window_id_to_shelf_id_.insert(
370 std::make_pair(user_window->window_id, shelf_id)); 371 std::make_pair(user_window->window_id, shelf_id));
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 StatusAreaWidget* status_widget = widget->status_area_widget(); 472 StatusAreaWidget* status_widget = widget->status_area_widget();
472 mus::Window* status_window = 473 mus::Window* status_window =
473 aura::GetMusWindow(status_widget->GetNativeWindow()); 474 aura::GetMusWindow(status_widget->GetNativeWindow());
474 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size(); 475 gfx::Size status_size = status_widget->GetWindowBoundsInScreen().size();
475 status_window->SetSharedProperty<gfx::Size>( 476 status_window->SetSharedProperty<gfx::Size>(
476 mus::mojom::WindowManager::kPreferredSize_Property, status_size); 477 mus::mojom::WindowManager::kPreferredSize_Property, status_size);
477 } 478 }
478 479
479 } // namespace sysui 480 } // namespace sysui
480 } // namespace ash 481 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sysui/shelf_delegate_mus.h ('k') | ash/sysui/shell_delegate_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698