| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/app_list_menu.h" | 5 #include "ui/app_list/app_list_menu.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
| 9 #include "ui/app_list/app_list_view_delegate.h" | 9 #include "ui/app_list/app_list_view_delegate.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 void AppListMenu::InitMenu() { | 25 void AppListMenu::InitMenu() { |
| 26 // User selector menu section. We don't show the user selector if there is | 26 // User selector menu section. We don't show the user selector if there is |
| 27 // only 1 user. | 27 // only 1 user. |
| 28 if (users_.size() > 1) { | 28 if (users_.size() > 1) { |
| 29 for (size_t i = 0; i < users_.size(); ++i) { | 29 for (size_t i = 0; i < users_.size(); ++i) { |
| 30 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 31 menu_model_.AddRadioItem(SELECT_PROFILE + i, | 31 menu_model_.AddRadioItem(SELECT_PROFILE + i, |
| 32 users_[i].email.empty() ? users_[i].name | 32 users_[i].email.empty() ? users_[i].name |
| 33 : users_[i].email, | 33 : users_[i].email, |
| 34 0 /* group_id */); | 34 0 /* group_id */); |
| 35 #elif defined(OS_WIN) | 35 #elif defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 36 menu_model_.AddItem(SELECT_PROFILE + i, users_[i].name); | 36 menu_model_.AddItem(SELECT_PROFILE + i, users_[i].name); |
| 37 int menu_index = menu_model_.GetIndexOfCommandId(SELECT_PROFILE + i); | 37 int menu_index = menu_model_.GetIndexOfCommandId(SELECT_PROFILE + i); |
| 38 menu_model_.SetSublabel(menu_index, users_[i].email); | 38 menu_model_.SetSublabel(menu_index, users_[i].email); |
| 39 // Use custom check mark. | 39 // Use custom check mark. |
| 40 if (users_[i].active) { | 40 if (users_[i].active) { |
| 41 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 41 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 42 menu_model_.SetIcon(menu_index, gfx::Image(*rb.GetImageSkiaNamed( | 42 menu_model_.SetIcon(menu_index, gfx::Image(*rb.GetImageSkiaNamed( |
| 43 IDR_APP_LIST_USER_INDICATOR))); | 43 IDR_APP_LIST_USER_INDICATOR))); |
| 44 } | 44 } |
| 45 #endif | 45 #endif |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 break; | 90 break; |
| 91 case SHOW_FEEDBACK: | 91 case SHOW_FEEDBACK: |
| 92 delegate_->OpenFeedback(); | 92 delegate_->OpenFeedback(); |
| 93 break; | 93 break; |
| 94 default: | 94 default: |
| 95 NOTREACHED(); | 95 NOTREACHED(); |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace app_list | 99 } // namespace app_list |
| OLD | NEW |