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/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_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" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "chrome/app/chrome_command_ids.h" | 15 #include "chrome/app/chrome_command_ids.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/defaults.h" | 17 #include "chrome/browser/defaults.h" |
18 #include "chrome/browser/extensions/extension_toolbar_model.h" | 18 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 19 #include "chrome/browser/extensions/extension_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/search/search.h" | 22 #include "chrome/browser/search/search.h" |
22 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
23 #include "chrome/browser/signin/signin_ui_util.h" | 24 #include "chrome/browser/signin/signin_ui_util.h" |
24 #include "chrome/browser/task_manager/task_manager.h" | 25 #include "chrome/browser/task_manager/task_manager.h" |
25 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 26 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
26 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/browser_commands.h" | 28 #include "chrome/browser/ui/browser_commands.h" |
28 #include "chrome/browser/ui/browser_finder.h" | 29 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 235 |
235 void ToolsMenuModel::Build(Browser* browser) { | 236 void ToolsMenuModel::Build(Browser* browser) { |
236 bool show_create_shortcuts = true; | 237 bool show_create_shortcuts = true; |
237 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 238 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
238 show_create_shortcuts = false; | 239 show_create_shortcuts = false; |
239 #elif defined(USE_ASH) | 240 #elif defined(USE_ASH) |
240 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 241 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
241 show_create_shortcuts = false; | 242 show_create_shortcuts = false; |
242 #endif | 243 #endif |
243 | 244 |
244 if (CommandLine::ForCurrentProcess()->HasSwitch( | 245 if (extensions::util::IsStreamlinedHostedAppsEnabled()) { |
245 switches::kEnableStreamlinedHostedApps)) { | |
246 AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_CREATE_HOSTED_APP); | 246 AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_CREATE_HOSTED_APP); |
247 AddSeparator(ui::NORMAL_SEPARATOR); | 247 AddSeparator(ui::NORMAL_SEPARATOR); |
248 } else if (show_create_shortcuts) { | 248 } else if (show_create_shortcuts) { |
249 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS); | 249 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS); |
250 AddSeparator(ui::NORMAL_SEPARATOR); | 250 AddSeparator(ui::NORMAL_SEPARATOR); |
251 } | 251 } |
252 | 252 |
253 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS); | 253 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS); |
254 | 254 |
255 if (chrome::CanOpenTaskManager()) | 255 if (chrome::CanOpenTaskManager()) |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 ->GetZoomPercent(); | 795 ->GetZoomPercent(); |
796 } | 796 } |
797 zoom_label_ = l10n_util::GetStringFUTF16( | 797 zoom_label_ = l10n_util::GetStringFUTF16( |
798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
799 } | 799 } |
800 | 800 |
801 void WrenchMenuModel::OnZoomLevelChanged( | 801 void WrenchMenuModel::OnZoomLevelChanged( |
802 const content::HostZoomMap::ZoomLevelChange& change) { | 802 const content::HostZoomMap::ZoomLevelChange& change) { |
803 UpdateZoomControls(); | 803 UpdateZoomControls(); |
804 } | 804 } |
OLD | NEW |