| 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 window()->ZoomChangedForActiveTab(false); | 1079 window()->ZoomChangedForActiveTab(false); |
| 1080 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, | 1080 command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, |
| 1081 CanViewSource(browser_)); | 1081 CanViewSource(browser_)); |
| 1082 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, | 1082 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, |
| 1083 CanEmailPageLocation(browser_)); | 1083 CanEmailPageLocation(browser_)); |
| 1084 if (browser_->is_devtools()) | 1084 if (browser_->is_devtools()) |
| 1085 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); | 1085 command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); |
| 1086 | 1086 |
| 1087 // Changing the encoding is not possible on Chrome-internal webpages. | 1087 // Changing the encoding is not possible on Chrome-internal webpages. |
| 1088 NavigationController& nc = current_web_contents->GetController(); | 1088 NavigationController& nc = current_web_contents->GetController(); |
| 1089 bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || | 1089 bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) || |
| 1090 current_web_contents->ShowingInterstitialPage(); | 1090 current_web_contents->ShowingInterstitialPage(); |
| 1091 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, | 1091 command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, |
| 1092 !is_chrome_internal && current_web_contents->IsSavable()); | 1092 !is_chrome_internal && current_web_contents->IsSavable()); |
| 1093 | 1093 |
| 1094 // Show various bits of UI | 1094 // Show various bits of UI |
| 1095 // TODO(pinkerton): Disable app-mode in the model until we implement it | 1095 // TODO(pinkerton): Disable app-mode in the model until we implement it |
| 1096 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | 1096 // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 |
| 1097 #if !defined(OS_MACOSX) | 1097 #if !defined(OS_MACOSX) |
| 1098 command_updater_.UpdateCommandEnabled( | 1098 command_updater_.UpdateCommandEnabled( |
| 1099 IDC_CREATE_SHORTCUTS, | 1099 IDC_CREATE_SHORTCUTS, |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 | 1328 |
| 1329 BrowserWindow* BrowserCommandController::window() { | 1329 BrowserWindow* BrowserCommandController::window() { |
| 1330 return browser_->window(); | 1330 return browser_->window(); |
| 1331 } | 1331 } |
| 1332 | 1332 |
| 1333 Profile* BrowserCommandController::profile() { | 1333 Profile* BrowserCommandController::profile() { |
| 1334 return browser_->profile(); | 1334 return browser_->profile(); |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 } // namespace chrome | 1337 } // namespace chrome |
| OLD | NEW |