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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 EncodingMenuController::EncodingMenuItemList encoding_menu_items; | 91 EncodingMenuController::EncodingMenuItemList encoding_menu_items; |
92 EncodingMenuController encoding_menu_controller; | 92 EncodingMenuController encoding_menu_controller; |
93 encoding_menu_controller.GetEncodingMenuItems(browser_->profile(), | 93 encoding_menu_controller.GetEncodingMenuItems(browser_->profile(), |
94 &encoding_menu_items); | 94 &encoding_menu_items); |
95 | 95 |
96 int group_id = 0; | 96 int group_id = 0; |
97 EncodingMenuController::EncodingMenuItemList::iterator it = | 97 EncodingMenuController::EncodingMenuItemList::iterator it = |
98 encoding_menu_items.begin(); | 98 encoding_menu_items.begin(); |
99 for (; it != encoding_menu_items.end(); ++it) { | 99 for (; it != encoding_menu_items.end(); ++it) { |
100 int id = it->first; | 100 int id = it->first; |
101 std::wstring& label = it->second; | 101 string16& label = it->second; |
102 if (id == 0) { | 102 if (id == 0) { |
103 AddSeparator(); | 103 AddSeparator(); |
104 } else { | 104 } else { |
105 if (id == IDC_ENCODING_AUTO_DETECT) { | 105 if (id == IDC_ENCODING_AUTO_DETECT) { |
106 AddCheckItem(id, WideToUTF16Hack(label)); | 106 AddCheckItem(id, label); |
107 } else { | 107 } else { |
108 // Use the id of the first radio command as the id of the group. | 108 // Use the id of the first radio command as the id of the group. |
109 if (group_id <= 0) | 109 if (group_id <= 0) |
110 group_id = id; | 110 group_id = id; |
111 AddRadioItem(id, WideToUTF16Hack(label), group_id); | 111 AddRadioItem(id, label, group_id); |
112 } | 112 } |
113 } | 113 } |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { | 117 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { |
118 TabContents* current_tab = browser_->GetSelectedTabContents(); | 118 TabContents* current_tab = browser_->GetSelectedTabContents(); |
119 EncodingMenuController controller; | 119 EncodingMenuController controller; |
120 return controller.IsItemChecked(browser_->profile(), | 120 return controller.IsItemChecked(browser_->profile(), |
121 current_tab->encoding(), command_id); | 121 current_tab->encoding(), command_id); |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 app_menu_contents_->AddItem(IDC_ABOUT, | 1099 app_menu_contents_->AddItem(IDC_ABOUT, |
1100 l10n_util::GetStringFUTF16( | 1100 l10n_util::GetStringFUTF16( |
1101 IDS_ABOUT, | 1101 IDS_ABOUT, |
1102 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 1102 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
1103 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); | 1103 app_menu_contents_->AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE); |
1104 app_menu_contents_->AddSeparator(); | 1104 app_menu_contents_->AddSeparator(); |
1105 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 1105 app_menu_contents_->AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
1106 | 1106 |
1107 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); | 1107 app_menu_menu_.reset(new views::Menu2(app_menu_contents_.get())); |
1108 } | 1108 } |
OLD | NEW |