Chromium Code Reviews| 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/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 844 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); | 844 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); |
| 845 UpdateCommandsForDevTools(); | 845 UpdateCommandsForDevTools(); |
| 846 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, CanOpenTaskManager()); | 846 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, CanOpenTaskManager()); |
| 847 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, | 847 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, |
| 848 !Profile::IsGuestSession()); | 848 !Profile::IsGuestSession()); |
| 849 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 849 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
| 850 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); | 850 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); |
| 851 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); | 851 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); |
| 852 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, | 852 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, |
| 853 !Profile::IsGuestSession()); | 853 !Profile::IsGuestSession()); |
| 854 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, | |
| 855 !Profile::IsGuestSession()); | |
|
sky
2012/11/07 00:10:47
I don't think we should show it for incognito wind
kuan
2012/11/07 02:29:46
IDC_RECENT_TABS_MENU is only added if instant exte
sky
2012/11/07 14:40:12
Even so, shouldn't we correctly disable the comman
kuan
2012/11/07 16:48:52
Done.
| |
| 854 | 856 |
| 855 command_updater_.UpdateCommandEnabled( | 857 command_updater_.UpdateCommandEnabled( |
| 856 IDC_SHOW_SYNC_SETUP, profile()->GetOriginalProfile()->IsSyncAccessible()); | 858 IDC_SHOW_SYNC_SETUP, profile()->GetOriginalProfile()->IsSyncAccessible()); |
| 857 | 859 |
| 858 // Initialize other commands based on the window type. | 860 // Initialize other commands based on the window type. |
| 859 bool normal_window = browser_->is_type_tabbed(); | 861 bool normal_window = browser_->is_type_tabbed(); |
| 860 | 862 |
| 861 // Navigation commands | 863 // Navigation commands |
| 862 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); | 864 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); |
| 863 | 865 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1177 | 1179 |
| 1178 BrowserWindow* BrowserCommandController::window() { | 1180 BrowserWindow* BrowserCommandController::window() { |
| 1179 return browser_->window(); | 1181 return browser_->window(); |
| 1180 } | 1182 } |
| 1181 | 1183 |
| 1182 Profile* BrowserCommandController::profile() { | 1184 Profile* BrowserCommandController::profile() { |
| 1183 return browser_->profile(); | 1185 return browser_->profile(); |
| 1184 } | 1186 } |
| 1185 | 1187 |
| 1186 } // namespace chrome | 1188 } // namespace chrome |
| OLD | NEW |