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

Side by Side Diff: ash/shelf/shelf_view.cc

Issue 1119983006: [ash/shelf] ResourceBundle should be used as pointer not non-const ref (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/shelf/overflow_button.cc ('k') | ash/shelf/shelf_widget.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 ShelfMenuModelAdapter::ShelfMenuModelAdapter(ShelfMenuModel* menu_model) 165 ShelfMenuModelAdapter::ShelfMenuModelAdapter(ShelfMenuModel* menu_model)
166 : MenuModelAdapter(menu_model), 166 : MenuModelAdapter(menu_model),
167 menu_model_(menu_model) { 167 menu_model_(menu_model) {
168 } 168 }
169 169
170 const gfx::FontList* ShelfMenuModelAdapter::GetLabelFontList( 170 const gfx::FontList* ShelfMenuModelAdapter::GetLabelFontList(
171 int command_id) const { 171 int command_id) const {
172 if (command_id != kCommandIdOfMenuName) 172 if (command_id != kCommandIdOfMenuName)
173 return MenuModelAdapter::GetLabelFontList(command_id); 173 return MenuModelAdapter::GetLabelFontList(command_id);
174 174
175 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 175 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
176 return &rb.GetFontList(ui::ResourceBundle::BoldFont); 176 return &rb->GetFontList(ui::ResourceBundle::BoldFont);
177 } 177 }
178 178
179 bool ShelfMenuModelAdapter::IsCommandEnabled(int id) const { 179 bool ShelfMenuModelAdapter::IsCommandEnabled(int id) const {
180 return id != kCommandIdOfMenuName; 180 return id != kCommandIdOfMenuName;
181 } 181 }
182 182
183 bool ShelfMenuModelAdapter::GetForegroundColor(int command_id, 183 bool ShelfMenuModelAdapter::GetForegroundColor(int command_id,
184 bool is_hovered, 184 bool is_hovered,
185 SkColor* override_color) const { 185 SkColor* override_color) const {
186 if (command_id != kCommandIdOfMenuName) 186 if (command_id != kCommandIdOfMenuName)
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 distance = bounds.x() - coordinate.x(); 1994 distance = bounds.x() - coordinate.x();
1995 break; 1995 break;
1996 case SHELF_ALIGNMENT_TOP: 1996 case SHELF_ALIGNMENT_TOP:
1997 distance = coordinate.y() - bounds.bottom(); 1997 distance = coordinate.y() - bounds.bottom();
1998 break; 1998 break;
1999 } 1999 }
2000 return distance > 0 ? distance : 0; 2000 return distance > 0 ? distance : 0;
2001 } 2001 }
2002 2002
2003 } // namespace ash 2003 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.cc ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698