Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 511923002: Move 'Extensions' to the main menu for settings-in-a-window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, Fix spelling Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 #endif 242 #endif
243 243
244 if (extensions::util::IsStreamlinedHostedAppsEnabled()) { 244 if (extensions::util::IsStreamlinedHostedAppsEnabled()) {
245 AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_CREATE_HOSTED_APP); 245 AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_CREATE_HOSTED_APP);
246 AddSeparator(ui::NORMAL_SEPARATOR); 246 AddSeparator(ui::NORMAL_SEPARATOR);
247 } else if (show_create_shortcuts) { 247 } else if (show_create_shortcuts) {
248 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS); 248 AddItemWithStringId(IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS);
249 AddSeparator(ui::NORMAL_SEPARATOR); 249 AddSeparator(ui::NORMAL_SEPARATOR);
250 } 250 }
251 251
252 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS); 252 // If settings-in-a-window is enabled the Extensions item is at the top level.
253 if (!::switches::SettingsWindowEnabled())
254 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS);
253 255
254 if (chrome::CanOpenTaskManager()) 256 if (chrome::CanOpenTaskManager())
255 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); 257 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
256 258
257 AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA); 259 AddItemWithStringId(IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA);
258 260
259 AddSeparator(ui::NORMAL_SEPARATOR); 261 AddSeparator(ui::NORMAL_SEPARATOR);
260 262
261 encoding_menu_model_.reset(new EncodingMenuModel(browser)); 263 encoding_menu_model_.reset(new EncodingMenuModel(browser));
262 AddSubMenuWithStringId(IDC_ENCODING_MENU, IDS_ENCODING_MENU, 264 AddSubMenuWithStringId(IDC_ENCODING_MENU, IDS_ENCODING_MENU,
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 608
607 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); 609 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE);
608 AddItemWithStringId(IDC_FIND, IDS_FIND); 610 AddItemWithStringId(IDC_FIND, IDS_FIND);
609 AddItemWithStringId(IDC_PRINT, IDS_PRINT); 611 AddItemWithStringId(IDC_PRINT, IDS_PRINT);
610 612
611 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); 613 tools_menu_model_.reset(new ToolsMenuModel(this, browser_));
612 CreateZoomMenu(); 614 CreateZoomMenu();
613 615
614 AddItemWithStringId(IDC_SHOW_HISTORY, IDS_SHOW_HISTORY); 616 AddItemWithStringId(IDC_SHOW_HISTORY, IDS_SHOW_HISTORY);
615 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); 617 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS);
618 // If settings-in-a-window is enabled the Extensions item is at the top level.
619 if (::switches::SettingsWindowEnabled())
620 AddItemWithStringId(IDC_MANAGE_EXTENSIONS, IDS_SHOW_EXTENSIONS);
616 AddSeparator(ui::NORMAL_SEPARATOR); 621 AddSeparator(ui::NORMAL_SEPARATOR);
617 622
618 #if !defined(OS_CHROMEOS) 623 #if !defined(OS_CHROMEOS)
619 if (!switches::IsNewAvatarMenu()) { 624 if (!switches::IsNewAvatarMenu()) {
620 // No "Sign in to Chromium..." menu item on ChromeOS. 625 // No "Sign in to Chromium..." menu item on ChromeOS.
621 SigninManager* signin = SigninManagerFactory::GetForProfile( 626 SigninManager* signin = SigninManagerFactory::GetForProfile(
622 browser_->profile()->GetOriginalProfile()); 627 browser_->profile()->GetOriginalProfile());
623 if (signin && signin->IsSigninAllowed()) { 628 if (signin && signin->IsSigninAllowed()) {
624 const base::string16 short_product_name = 629 const base::string16 short_product_name =
625 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); 630 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 ->GetZoomPercent(); 800 ->GetZoomPercent();
796 } 801 }
797 zoom_label_ = l10n_util::GetStringFUTF16( 802 zoom_label_ = l10n_util::GetStringFUTF16(
798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 803 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
799 } 804 }
800 805
801 void WrenchMenuModel::OnZoomLevelChanged( 806 void WrenchMenuModel::OnZoomLevelChanged(
802 const content::HostZoomMap::ZoomLevelChange& change) { 807 const content::HostZoomMap::ZoomLevelChange& change) {
803 UpdateZoomControls(); 808 UpdateZoomControls();
804 } 809 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698