| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Use default icon. | 131 // Use default icon. |
| 132 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 132 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 133 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); | 133 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); |
| 134 } | 134 } |
| 135 return icon_image; | 135 return icon_image; |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Returns the WmShelf instance for the display with the given |display_id|. | 138 // Returns the WmShelf instance for the display with the given |display_id|. |
| 139 WmShelf* GetShelfForDisplay(int64_t display_id) { | 139 WmShelf* GetShelfForDisplay(int64_t display_id) { |
| 140 // The controller may be null for invalid ids or for displays being removed. | 140 // The controller may be null for invalid ids or for displays being removed. |
| 141 WmRootWindowController* root_window_controller = | 141 RootWindowController* root_window_controller = |
| 142 WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); | 142 WmLookup::Get()->GetRootWindowControllerWithDisplayId(display_id); |
| 143 return root_window_controller ? root_window_controller->GetShelf() : nullptr; | 143 return root_window_controller ? root_window_controller->GetShelf() : nullptr; |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace | 146 } // namespace |
| 147 | 147 |
| 148 ShelfController::ShelfController() {} | 148 ShelfController::ShelfController() {} |
| 149 | 149 |
| 150 ShelfController::~ShelfController() {} | 150 ShelfController::~ShelfController() {} |
| 151 | 151 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 return; | 259 return; |
| 260 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | 260 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; |
| 261 int index = model_.ItemIndexByID(shelf_id); | 261 int index = model_.ItemIndexByID(shelf_id); |
| 262 DCHECK_GE(index, 0); | 262 DCHECK_GE(index, 0); |
| 263 ShelfItem item = *model_.ItemByID(shelf_id); | 263 ShelfItem item = *model_.ItemByID(shelf_id); |
| 264 item.image = GetShelfIconFromBitmap(image); | 264 item.image = GetShelfIconFromBitmap(image); |
| 265 model_.Set(index, item); | 265 model_.Set(index, item); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace ash | 268 } // namespace ash |
| OLD | NEW |