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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1098 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); | 1098 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); |
1099 | 1099 |
1100 // Changing the encoding is not possible on Chrome-internal webpages. | 1100 // Changing the encoding is not possible on Chrome-internal webpages. |
1101 NavigationController& nc = current_web_contents->GetController(); | 1101 NavigationController& nc = current_web_contents->GetController(); |
1102 bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) || | 1102 bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) || |
1103 current_web_contents->ShowingInterstitialPage(); | 1103 current_web_contents->ShowingInterstitialPage(); |
1104 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, | 1104 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, |
1105 !is_chrome_internal && current_web_contents->IsSavable()); | 1105 !is_chrome_internal && current_web_contents->IsSavable()); |
1106 | 1106 |
1107 // Show various bits of UI | 1107 // Show various bits of UI |
1108 // TODO(pinkerton): Disable app-mode in the model until we implement it | |
1109 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | |
1110 #if !defined(OS_MACOSX) | |
1111 command_updater_.UpdateCommandEnabled( | 1108 command_updater_.UpdateCommandEnabled( |
1112 IDC_CREATE_SHORTCUTS, | 1109 IDC_CREATE_SHORTCUTS, |
1113 CanCreateApplicationShortcuts(browser_)); | 1110 CanCreateApplicationShortcuts(browser_)); |
1114 command_updater_.UpdateCommandEnabled(IDC_CREATE_HOSTED_APP, | 1111 command_updater_.UpdateCommandEnabled(IDC_CREATE_HOSTED_APP, |
jackhou1
2014/11/27 05:51:52
If we're leaving IDC_CREATE_SHORCUTS if-defed out
mitchellj
2014/11/27 23:29:45
Done.
| |
1115 CanCreateBookmarkApp(browser_)); | 1112 CanCreateBookmarkApp(browser_)); |
1116 #endif | |
1117 | 1113 |
1118 command_updater_.UpdateCommandEnabled( | 1114 command_updater_.UpdateCommandEnabled( |
1119 IDC_TOGGLE_REQUEST_TABLET_SITE, | 1115 IDC_TOGGLE_REQUEST_TABLET_SITE, |
1120 CanRequestTabletSite(current_web_contents)); | 1116 CanRequestTabletSite(current_web_contents)); |
1121 | 1117 |
1122 UpdateCommandsForContentRestrictionState(); | 1118 UpdateCommandsForContentRestrictionState(); |
1123 UpdateCommandsForBookmarkEditing(); | 1119 UpdateCommandsForBookmarkEditing(); |
1124 UpdateCommandsForFind(); | 1120 UpdateCommandsForFind(); |
1125 // Update the zoom commands when an active tab is selected. | 1121 // Update the zoom commands when an active tab is selected. |
1126 UpdateCommandsForZoomState(); | 1122 UpdateCommandsForZoomState(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1342 | 1338 |
1343 BrowserWindow* BrowserCommandController::window() { | 1339 BrowserWindow* BrowserCommandController::window() { |
1344 return browser_->window(); | 1340 return browser_->window(); |
1345 } | 1341 } |
1346 | 1342 |
1347 Profile* BrowserCommandController::profile() { | 1343 Profile* BrowserCommandController::profile() { |
1348 return browser_->profile(); | 1344 return browser_->profile(); |
1349 } | 1345 } |
1350 | 1346 |
1351 } // namespace chrome | 1347 } // namespace chrome |
OLD | NEW |