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

Side by Side Diff: chrome/browser/ui/browser_command_controller.cc

Issue 489313002: Centralize command line checks for kEnableStreamlinedHostedApps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | 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/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/defaults.h" 12 #include "chrome/browser/defaults.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/extension_util.h"
14 #include "chrome/browser/lifetime/application_lifetime.h" 15 #include "chrome/browser/lifetime/application_lifetime.h"
15 #include "chrome/browser/prefs/incognito_mode_prefs.h" 16 #include "chrome/browser/prefs/incognito_mode_prefs.h"
16 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/sessions/tab_restore_service.h" 18 #include "chrome/browser/sessions/tab_restore_service.h"
18 #include "chrome/browser/sessions/tab_restore_service_factory.h" 19 #include "chrome/browser/sessions/tab_restore_service_factory.h"
19 #include "chrome/browser/shell_integration.h" 20 #include "chrome/browser/shell_integration.h"
20 #include "chrome/browser/signin/signin_promo.h" 21 #include "chrome/browser/signin/signin_promo.h"
21 #include "chrome/browser/sync/profile_sync_service.h" 22 #include "chrome/browser/sync/profile_sync_service.h"
22 #include "chrome/browser/sync/profile_sync_service_factory.h" 23 #include "chrome/browser/sync/profile_sync_service_factory.h"
23 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" 24 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 // Chrome OS uses the system tray menu to handle multi-profiles. 973 // Chrome OS uses the system tray menu to handle multi-profiles.
973 if (normal_window && (guest_session || !profile()->IsOffTheRecord())) 974 if (normal_window && (guest_session || !profile()->IsOffTheRecord()))
974 command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU, true); 975 command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU, true);
975 #endif 976 #endif
976 977
977 UpdateShowSyncState(true); 978 UpdateShowSyncState(true);
978 979
979 // Navigation commands 980 // Navigation commands
980 command_updater_.UpdateCommandEnabled( 981 command_updater_.UpdateCommandEnabled(
981 IDC_HOME, 982 IDC_HOME,
982 normal_window || (CommandLine::ForCurrentProcess()->HasSwitch( 983 normal_window || (extensions::util::IsStreamlinedHostedAppsEnabled() &&
983 switches::kEnableStreamlinedHostedApps) &&
984 browser_->is_app())); 984 browser_->is_app()));
985 985
986 // Window management commands 986 // Window management commands
987 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window); 987 command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window);
988 command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB, 988 command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB,
989 normal_window); 989 normal_window);
990 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_NEXT, normal_window); 990 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_NEXT, normal_window);
991 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_PREVIOUS, normal_window); 991 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_PREVIOUS, normal_window);
992 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_0, normal_window); 992 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_0, normal_window);
993 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_1, normal_window); 993 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_1, normal_window);
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 1355
1356 BrowserWindow* BrowserCommandController::window() { 1356 BrowserWindow* BrowserCommandController::window() {
1357 return browser_->window(); 1357 return browser_->window();
1358 } 1358 }
1359 1359
1360 Profile* BrowserCommandController::profile() { 1360 Profile* BrowserCommandController::profile() {
1361 return browser_->profile(); 1361 return browser_->profile();
1362 } 1362 }
1363 1363
1364 } // namespace chrome 1364 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698