OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/wrench_menu_model.h" | 5 #include "chrome/browser/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 DCHECK_EQ(NotificationType::ZOOM_LEVEL_CHANGED, type.value); | 156 DCHECK_EQ(NotificationType::ZOOM_LEVEL_CHANGED, type.value); |
157 UpdateZoomControls(); | 157 UpdateZoomControls(); |
158 } | 158 } |
159 | 159 |
160 void WrenchMenuModel::Build() { | 160 void WrenchMenuModel::Build() { |
161 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); | 161 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); |
162 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); | 162 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); |
163 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); | 163 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); |
164 | 164 |
165 AddSeparator(); | 165 AddSeparator(); |
166 #if defined(OS_LINUX) | 166 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
167 edit_menu_item_model_.reset(new menus::ButtonMenuItemModel(IDS_EDIT, this)); | 167 edit_menu_item_model_.reset(new menus::ButtonMenuItemModel(IDS_EDIT, this)); |
168 edit_menu_item_model_->AddItemWithStringId(IDC_CUT, IDS_CUT); | 168 edit_menu_item_model_->AddItemWithStringId(IDC_CUT, IDS_CUT); |
169 edit_menu_item_model_->AddItemWithStringId(IDC_COPY, IDS_COPY); | 169 edit_menu_item_model_->AddItemWithStringId(IDC_COPY, IDS_COPY); |
170 edit_menu_item_model_->AddItemWithStringId(IDC_PASTE, IDS_PASTE); | 170 edit_menu_item_model_->AddItemWithStringId(IDC_PASTE, IDS_PASTE); |
171 AddButtonItem(0, edit_menu_item_model_.get()); | 171 AddButtonItem(0, edit_menu_item_model_.get()); |
172 #else | 172 #else |
173 // TODO(port): Move to the above. | 173 // TODO(port): Move to the above. |
174 CreateCutCopyPaste(); | 174 CreateCutCopyPaste(); |
175 #endif | 175 #endif |
176 | 176 |
177 AddSeparator(); | 177 AddSeparator(); |
178 #if defined(OS_LINUX) | 178 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) |
179 zoom_menu_item_model_.reset( | 179 zoom_menu_item_model_.reset( |
180 new menus::ButtonMenuItemModel(IDS_ZOOM_MENU, this)); | 180 new menus::ButtonMenuItemModel(IDS_ZOOM_MENU, this)); |
181 zoom_menu_item_model_->AddItemWithStringId(IDC_ZOOM_PLUS, IDS_ZOOM_PLUS2); | 181 zoom_menu_item_model_->AddItemWithStringId(IDC_ZOOM_PLUS, IDS_ZOOM_PLUS2); |
182 zoom_menu_item_model_->AddItemWithStringId(IDC_ZOOM_MINUS, IDS_ZOOM_MINUS2); | 182 zoom_menu_item_model_->AddItemWithStringId(IDC_ZOOM_MINUS, IDS_ZOOM_MINUS2); |
183 zoom_menu_item_model_->AddSpace(); | 183 zoom_menu_item_model_->AddSpace(); |
184 zoom_menu_item_model_->AddItemWithImage( | 184 zoom_menu_item_model_->AddItemWithImage( |
185 IDC_FULLSCREEN, IDR_FULLSCREEN_MENU_BUTTON); | 185 IDC_FULLSCREEN, IDR_FULLSCREEN_MENU_BUTTON); |
186 AddButtonItem(0, zoom_menu_item_model_.get()); | 186 AddButtonItem(0, zoom_menu_item_model_.get()); |
187 #else | 187 #else |
188 // TODO(port): Move to the above. | 188 // TODO(port): Move to the above. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 286 } |
287 return l10n_util::GetStringFUTF16( | 287 return l10n_util::GetStringFUTF16( |
288 IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 288 IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
289 } | 289 } |
290 | 290 |
291 bool WrenchMenuModel::IsDynamicItem(int index) const { | 291 bool WrenchMenuModel::IsDynamicItem(int index) const { |
292 int command_id = GetCommandIdAt(index); | 292 int command_id = GetCommandIdAt(index); |
293 return command_id == IDC_SYNC_BOOKMARKS || | 293 return command_id == IDC_SYNC_BOOKMARKS || |
294 command_id == IDC_ABOUT; | 294 command_id == IDC_ABOUT; |
295 } | 295 } |
OLD | NEW |