| 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/common/shelf/shelf_controller.h" | 5 #include "ash/common/shelf/shelf_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/shelf_item_delegate.h" | 7 #include "ash/common/shelf/shelf_item_delegate.h" |
| 8 #include "ash/common/shelf/shelf_menu_model.h" | 8 #include "ash/common/shelf/shelf_menu_model.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/wm_lookup.h" | 10 #include "ash/common/wm_lookup.h" |
| 11 #include "ash/common/wm_root_window_controller.h" | |
| 12 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 13 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 13 #include "ash/root_window_controller.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/display/display.h" | 16 #include "ui/display/display.h" |
| 17 #include "ui/display/screen.h" | 17 #include "ui/display/screen.h" |
| 18 #include "ui/gfx/image/image_skia.h" | 18 #include "ui/gfx/image/image_skia.h" |
| 19 #include "ui/resources/grit/ui_resources.h" | 19 #include "ui/resources/grit/ui_resources.h" |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Use default icon. | 136 // Use default icon. |
| 137 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 137 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 138 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); | 138 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); |
| 139 } | 139 } |
| 140 return icon_image; | 140 return icon_image; |
| 141 } | 141 } |
| 142 | 142 |
| 143 // Returns the WmShelf instance for the display with the given |display_id|. | 143 // Returns the WmShelf instance for the display with the given |display_id|. |
| 144 WmShelf* GetShelfForDisplay(int64_t display_id) { | 144 WmShelf* GetShelfForDisplay(int64_t display_id) { |
| 145 // The controller may be null for invalid ids or for displays being removed. | 145 // The controller may be null for invalid ids or for displays being removed. |
| 146 WmRootWindowController* root_window_controller = | 146 RootWindowController* root_window_controller = |
| 147 WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); | 147 WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); |
| 148 return root_window_controller ? root_window_controller->GetShelf() : nullptr; | 148 return root_window_controller ? root_window_controller->GetShelf() : nullptr; |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 | 152 |
| 153 ShelfController::ShelfController() {} | 153 ShelfController::ShelfController() {} |
| 154 | 154 |
| 155 ShelfController::~ShelfController() {} | 155 ShelfController::~ShelfController() {} |
| 156 | 156 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 return; | 263 return; |
| 264 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | 264 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; |
| 265 int index = model_.ItemIndexByID(shelf_id); | 265 int index = model_.ItemIndexByID(shelf_id); |
| 266 DCHECK_GE(index, 0); | 266 DCHECK_GE(index, 0); |
| 267 ShelfItem item = *model_.ItemByID(shelf_id); | 267 ShelfItem item = *model_.ItemByID(shelf_id); |
| 268 item.image = GetShelfIconFromBitmap(image); | 268 item.image = GetShelfIconFromBitmap(image); |
| 269 model_.Set(index, item); | 269 model_.Set(index, item); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace ash | 272 } // namespace ash |
| OLD | NEW |