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 "chrome/browser/ui/toolbar/app_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/app_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 ToolsMenuModel::~ToolsMenuModel() {} | 244 ToolsMenuModel::~ToolsMenuModel() {} |
245 | 245 |
246 // More tools submenu is constructed as follows: | 246 // More tools submenu is constructed as follows: |
247 // - Page specific actions overflow (save page, adding to desktop). | 247 // - Page specific actions overflow (save page, adding to desktop). |
248 // - Browser / OS level tools (extensions, task manager). | 248 // - Browser / OS level tools (extensions, task manager). |
249 // - Developer tools. | 249 // - Developer tools. |
250 // - Option to enable profiling. | 250 // - Option to enable profiling. |
251 void ToolsMenuModel::Build(Browser* browser) { | 251 void ToolsMenuModel::Build(Browser* browser) { |
252 bool show_create_shortcuts = true; | 252 bool show_create_shortcuts = true; |
253 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 253 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(USE_ASH) |
254 show_create_shortcuts = false; | 254 show_create_shortcuts = false; |
255 #elif defined(USE_ASH) | |
256 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | |
257 show_create_shortcuts = false; | |
258 #endif | 255 #endif |
259 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); | 256 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); |
260 if (extensions::util::IsNewBookmarkAppsEnabled()) { | 257 if (extensions::util::IsNewBookmarkAppsEnabled()) { |
261 int string_id = IDS_ADD_TO_DESKTOP; | 258 int string_id = IDS_ADD_TO_DESKTOP; |
262 #if defined(OS_MACOSX) | 259 #if defined(OS_MACOSX) |
263 string_id = IDS_ADD_TO_APPLICATIONS; | 260 string_id = IDS_ADD_TO_APPLICATIONS; |
264 #endif | 261 #endif |
265 #if defined(USE_ASH) | 262 #if defined(USE_ASH) |
266 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 263 string_id = IDS_ADD_TO_SHELF; |
267 string_id = IDS_ADD_TO_SHELF; | |
268 #endif // defined(USE_ASH) | 264 #endif // defined(USE_ASH) |
269 AddItemWithStringId(IDC_CREATE_HOSTED_APP, string_id); | 265 AddItemWithStringId(IDC_CREATE_HOSTED_APP, string_id); |
270 } else if (show_create_shortcuts) { | 266 } else if (show_create_shortcuts) { |
271 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS); | 267 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS); |
272 } | 268 } |
273 | 269 |
274 AddSeparator(ui::NORMAL_SEPARATOR); | 270 AddSeparator(ui::NORMAL_SEPARATOR); |
275 AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA); | 271 AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA); |
276 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS); | 272 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS); |
277 if (chrome::CanOpenTaskManager()) | 273 if (chrome::CanOpenTaskManager()) |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 ->GetZoomPercent(); | 943 ->GetZoomPercent(); |
948 } | 944 } |
949 zoom_label_ = l10n_util::GetStringFUTF16( | 945 zoom_label_ = l10n_util::GetStringFUTF16( |
950 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 946 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
951 } | 947 } |
952 | 948 |
953 void AppMenuModel::OnZoomLevelChanged( | 949 void AppMenuModel::OnZoomLevelChanged( |
954 const content::HostZoomMap::ZoomLevelChange& change) { | 950 const content::HostZoomMap::ZoomLevelChange& change) { |
955 UpdateZoomControls(); | 951 UpdateZoomControls(); |
956 } | 952 } |
OLD | NEW |