| 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/mus/shelf_delegate_mus.h" | 5 #include "ash/mus/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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 gfx::ImageSkia GetShelfIconFromSerializedBitmap( | 107 gfx::ImageSkia GetShelfIconFromSerializedBitmap( |
| 108 const mojo::Array<uint8_t>& serialized_bitmap) { | 108 const mojo::Array<uint8_t>& serialized_bitmap) { |
| 109 SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage()); | 109 SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage()); |
| 110 return GetShelfIconFromBitmap(bitmap); | 110 return GetShelfIconFromBitmap(bitmap); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| 114 | 114 |
| 115 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model) | 115 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model) |
| 116 : model_(model), binding_(this) { | 116 : model_(model), binding_(this) { |
| 117 mojo::Connector* connector = | 117 ::shell::Connector* connector = |
| 118 views::WindowManagerConnection::Get()->connector(); | 118 views::WindowManagerConnection::Get()->connector(); |
| 119 connector->ConnectToInterface("mojo:desktop_wm", &user_window_controller_); | 119 connector->ConnectToInterface("mojo:desktop_wm", &user_window_controller_); |
| 120 user_window_controller_->AddUserWindowObserver( | 120 user_window_controller_->AddUserWindowObserver( |
| 121 binding_.CreateInterfacePtrAndBind()); | 121 binding_.CreateInterfacePtrAndBind()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 ShelfDelegateMus::~ShelfDelegateMus() {} | 124 ShelfDelegateMus::~ShelfDelegateMus() {} |
| 125 | 125 |
| 126 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) { | 126 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) { |
| 127 ShelfWidget* widget = shelf->shelf_widget(); | 127 ShelfWidget* widget = shelf->shelf_widget(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 DCHECK_GE(index, 0); | 316 DCHECK_GE(index, 0); |
| 317 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); | 317 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); |
| 318 DCHECK(iter != model_->items().end()); | 318 DCHECK(iter != model_->items().end()); |
| 319 ShelfItem item = *iter; | 319 ShelfItem item = *iter; |
| 320 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; | 320 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; |
| 321 model_->Set(index, item); | 321 model_->Set(index, item); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace sysui | 324 } // namespace sysui |
| 325 } // namespace ash | 325 } // namespace ash |
| OLD | NEW |