| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 window()->ZoomChangedForActiveTab(false); | 1029 window()->ZoomChangedForActiveTab(false); |
| 1030 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, | 1030 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, |
| 1031 CanViewSource(browser_)); | 1031 CanViewSource(browser_)); |
| 1032 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, | 1032 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, |
| 1033 CanEmailPageLocation(browser_)); | 1033 CanEmailPageLocation(browser_)); |
| 1034 if (browser_->is_devtools()) | 1034 if (browser_->is_devtools()) |
| 1035 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); | 1035 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); |
| 1036 | 1036 |
| 1037 // Changing the encoding is not possible on Chrome-internal webpages. | 1037 // Changing the encoding is not possible on Chrome-internal webpages. |
| 1038 NavigationController& nc = current_web_contents->GetController(); | 1038 NavigationController& nc = current_web_contents->GetController(); |
| 1039 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || | 1039 bool is_chrome_internal = HasInternalURL(nc.GetVisibleEntry()) || |
| 1040 current_web_contents->ShowingInterstitialPage(); | 1040 current_web_contents->ShowingInterstitialPage(); |
| 1041 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, | 1041 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, |
| 1042 !is_chrome_internal && current_web_contents->IsSavable()); | 1042 !is_chrome_internal && current_web_contents->IsSavable()); |
| 1043 | 1043 |
| 1044 // Show various bits of UI | 1044 // Show various bits of UI |
| 1045 // TODO(pinkerton): Disable app-mode in the model until we implement it | 1045 // TODO(pinkerton): Disable app-mode in the model until we implement it |
| 1046 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | 1046 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 |
| 1047 #if !defined(OS_MACOSX) | 1047 #if !defined(OS_MACOSX) |
| 1048 command_updater_.UpdateCommandEnabled( | 1048 command_updater_.UpdateCommandEnabled( |
| 1049 IDC_CREATE_SHORTCUTS, | 1049 IDC_CREATE_SHORTCUTS, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 | 1273 |
| 1274 BrowserWindow* BrowserCommandController::window() { | 1274 BrowserWindow* BrowserCommandController::window() { |
| 1275 return browser_->window(); | 1275 return browser_->window(); |
| 1276 } | 1276 } |
| 1277 | 1277 |
| 1278 Profile* BrowserCommandController::profile() { | 1278 Profile* BrowserCommandController::profile() { |
| 1279 return browser_->profile(); | 1279 return browser_->profile(); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 } // namespace chrome | 1282 } // namespace chrome |
| OLD | NEW |