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

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

Issue 1832133002: mus: Remove unnecessary const from property TypeConverter templates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 4 years, 8 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 | « no previous file | ash/mus/sysui_application.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/mus/shelf_delegate_mus.h" 5 #include "ash/mus/shelf_delegate_mus.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shelf/shelf_item_delegate.h" 8 #include "ash/shelf/shelf_item_delegate.h"
9 #include "ash/shelf/shelf_item_delegate_manager.h" 9 #include "ash/shelf/shelf_item_delegate_manager.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); 79 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus);
80 }; 80 };
81 81
82 // Returns an icon image from a serialized SkBitmap, or the default shelf icon 82 // Returns an icon image from a serialized SkBitmap, or the default shelf icon
83 // image if the bitmap is empty. Assumes the bitmap is a 1x icon. 83 // image if the bitmap is empty. Assumes the bitmap is a 1x icon.
84 // TODO(jamescook): Support other scale factors. 84 // TODO(jamescook): Support other scale factors.
85 gfx::ImageSkia GetShelfIconFromBitmap( 85 gfx::ImageSkia GetShelfIconFromBitmap(
86 const mojo::Array<uint8_t>& serialized_bitmap) { 86 const mojo::Array<uint8_t>& serialized_bitmap) {
87 // Convert the data to an ImageSkia. 87 // Convert the data to an ImageSkia.
88 SkBitmap bitmap = mojo::ConvertTo<SkBitmap, const std::vector<uint8_t>>( 88 SkBitmap bitmap = mojo::ConvertTo<SkBitmap>(serialized_bitmap.storage());
89 serialized_bitmap.storage());
90 gfx::ImageSkia icon_image; 89 gfx::ImageSkia icon_image;
91 if (!bitmap.isNull()) { 90 if (!bitmap.isNull()) {
92 icon_image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); 91 icon_image = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
93 } else { 92 } else {
94 // Use default icon. 93 // Use default icon.
95 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 94 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
96 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); 95 icon_image = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
97 } 96 }
98 return icon_image; 97 return icon_image;
99 } 98 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 DCHECK_GE(index, 0); 236 DCHECK_GE(index, 0);
238 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); 237 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id);
239 DCHECK(iter != model_->items().end()); 238 DCHECK(iter != model_->items().end());
240 ShelfItem item = *iter; 239 ShelfItem item = *iter;
241 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; 240 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING;
242 model_->Set(index, item); 241 model_->Set(index, item);
243 } 242 }
244 243
245 } // namespace sysui 244 } // namespace sysui
246 } // namespace ash 245 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/mus/sysui_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698