OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/views/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/drag_drop_types.h" | 9 #include "app/drag_drop_types.h" |
10 #include "app/gfx/canvas.h" | 10 #include "app/gfx/canvas.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 int group_id = 0; | 99 int group_id = 0; |
100 EncodingMenuController::EncodingMenuItemList::iterator it = | 100 EncodingMenuController::EncodingMenuItemList::iterator it = |
101 encoding_menu_items.begin(); | 101 encoding_menu_items.begin(); |
102 for (; it != encoding_menu_items.end(); ++it) { | 102 for (; it != encoding_menu_items.end(); ++it) { |
103 int id = it->first; | 103 int id = it->first; |
104 std::wstring& label = it->second; | 104 std::wstring& label = it->second; |
105 if (id == 0) { | 105 if (id == 0) { |
106 AddSeparator(); | 106 AddSeparator(); |
107 } else { | 107 } else { |
108 if (id == IDC_ENCODING_AUTO_DETECT) { | 108 if (id == IDC_ENCODING_AUTO_DETECT) { |
109 AddCheckItem(id, label); | 109 AddCheckItem(id, WideToUTF16Hack(label)); |
110 } else { | 110 } else { |
111 // Use the id of the first radio command as the id of the group. | 111 // Use the id of the first radio command as the id of the group. |
112 if (group_id <= 0) | 112 if (group_id <= 0) |
113 group_id = id; | 113 group_id = id; |
114 AddRadioItem(id, label, group_id); | 114 AddRadioItem(id, WideToUTF16Hack(label), group_id); |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { | 120 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { |
121 TabContents* current_tab = browser_->GetSelectedTabContents(); | 121 TabContents* current_tab = browser_->GetSelectedTabContents(); |
122 EncodingMenuController controller; | 122 EncodingMenuController controller; |
123 return controller.IsItemChecked(browser_->profile(), | 123 return controller.IsItemChecked(browser_->profile(), |
124 current_tab->encoding(), command_id); | 124 current_tab->encoding(), command_id); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 return; | 283 return; |
284 | 284 |
285 // Store the latest list of profiles in the browser. | 285 // Store the latest list of profiles in the browser. |
286 browser_->set_user_data_dir_profiles(profiles); | 286 browser_->set_user_data_dir_profiles(profiles); |
287 | 287 |
288 // Add direct sub menu items for profiles. | 288 // Add direct sub menu items for profiles. |
289 std::vector<std::wstring>::const_iterator iter = profiles.begin(); | 289 std::vector<std::wstring>::const_iterator iter = profiles.begin(); |
290 for (int i = IDC_NEW_WINDOW_PROFILE_0; | 290 for (int i = IDC_NEW_WINDOW_PROFILE_0; |
291 (i <= IDC_NEW_WINDOW_PROFILE_LAST) && (iter != profiles.end()); | 291 (i <= IDC_NEW_WINDOW_PROFILE_LAST) && (iter != profiles.end()); |
292 ++i, ++iter) | 292 ++i, ++iter) |
293 profiles_menu_contents_->AddItem(i, *iter); | 293 profiles_menu_contents_->AddItem(i, WideToUTF16Hack(*iter)); |
294 | 294 |
295 // If there are more profiles then show "Other" link. | 295 // If there are more profiles then show "Other" link. |
296 if (iter != profiles.end()) { | 296 if (iter != profiles.end()) { |
297 profiles_menu_contents_->AddSeparator(); | 297 profiles_menu_contents_->AddSeparator(); |
298 profiles_menu_contents_->AddItemWithStringId(IDC_SELECT_PROFILE, | 298 profiles_menu_contents_->AddItemWithStringId(IDC_SELECT_PROFILE, |
299 IDS_SELECT_PROFILE); | 299 IDS_SELECT_PROFILE); |
300 } | 300 } |
301 | 301 |
302 // Always show a link to select a new profile. | 302 // Always show a link to select a new profile. |
303 profiles_menu_contents_->AddSeparator(); | 303 profiles_menu_contents_->AddSeparator(); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 IDC_P13N_INFO, | 1080 IDC_P13N_INFO, |
1081 Personalization::GetMenuItemInfoText(browser())); | 1081 Personalization::GetMenuItemInfoText(browser())); |
1082 } | 1082 } |
1083 #endif | 1083 #endif |
1084 app_menu_contents_->AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, | 1084 app_menu_contents_->AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, |
1085 IDS_CLEAR_BROWSING_DATA); | 1085 IDS_CLEAR_BROWSING_DATA); |
1086 app_menu_contents_->AddItemWithStringId(IDC_IMPORT_SETTINGS, | 1086 app_menu_contents_->AddItemWithStringId(IDC_IMPORT_SETTINGS, |
1087 IDS_IMPORT_SETTINGS); | 1087 IDS_IMPORT_SETTINGS); |
1088 app_menu_contents_->AddSeparator(); | 1088 app_menu_contents_->AddSeparator(); |
1089 app_menu_contents_->AddItem(IDC_OPTIONS, | 1089 app_menu_contents_->AddItem(IDC_OPTIONS, |
1090 l10n_util::GetStringF( | 1090 l10n_util::GetStringFUTF16( |
1091 IDS_OPTIONS, | 1091 IDS_OPTIONS, |
1092 l10n_util::GetString(IDS_PRODUCT_NAME))); | 1092 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1093 app_menu_contents_->AddItem(IDC_ABOUT, | 1093 app_menu_contents_->AddItem(IDC_ABOUT, |
1094 l10n_util::GetStringF( | 1094 l10n_util::GetStringFUTF16( |
1095 IDS_ABOUT, | 1095 IDS_ABOUT, |
1096 l10n_util::GetString(IDS_PRODUCT_NAME))); | 1096 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1097 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); | 1097 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); |
1098 app_menu_contents_->AddSeparator(); | 1098 app_menu_contents_->AddSeparator(); |
1099 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 1099 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
1100 | 1100 |
1101 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); | 1101 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); |
1102 } | 1102 } |
OLD | NEW |