| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |