| 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 "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" |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 | 950 |
| 951 // Show various bits of UI | 951 // Show various bits of UI |
| 952 const bool guest_session = profile()->IsGuestSession(); | 952 const bool guest_session = profile()->IsGuestSession(); |
| 953 const bool normal_window = browser_->is_type_tabbed(); | 953 const bool normal_window = browser_->is_type_tabbed(); |
| 954 UpdateOpenFileState(&command_updater_); | 954 UpdateOpenFileState(&command_updater_); |
| 955 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); | 955 command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); |
| 956 UpdateCommandsForDevTools(); | 956 UpdateCommandsForDevTools(); |
| 957 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, CanOpenTaskManager()); | 957 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, CanOpenTaskManager()); |
| 958 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, !guest_session); | 958 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, !guest_session); |
| 959 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 959 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
| 960 command_updater_.UpdateCommandEnabled(IDC_HELP_MENU, true); |
| 960 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); | 961 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); |
| 961 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); | 962 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); |
| 962 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, !guest_session); | 963 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, !guest_session); |
| 963 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, | 964 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, |
| 964 !guest_session && | 965 !guest_session && |
| 965 !profile()->IsOffTheRecord()); | 966 !profile()->IsOffTheRecord()); |
| 966 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); | 967 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); |
| 967 #if defined(OS_CHROMEOS) | 968 #if defined(OS_CHROMEOS) |
| 968 command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true); | 969 command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true); |
| 969 #else | 970 #else |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 | 1329 |
| 1329 BrowserWindow* BrowserCommandController::window() { | 1330 BrowserWindow* BrowserCommandController::window() { |
| 1330 return browser_->window(); | 1331 return browser_->window(); |
| 1331 } | 1332 } |
| 1332 | 1333 |
| 1333 Profile* BrowserCommandController::profile() { | 1334 Profile* BrowserCommandController::profile() { |
| 1334 return browser_->profile(); | 1335 return browser_->profile(); |
| 1335 } | 1336 } |
| 1336 | 1337 |
| 1337 } // namespace chrome | 1338 } // namespace chrome |
| OLD | NEW |