Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4077)

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 2254273003: Remove text encoding UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 1b2d8fa683233407acaf05fde2a0fe44d2f51243..ef5a797305afd5ee27f43283bb27073f27b90244 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -94,24 +94,6 @@ enum WindowState {
WINDOW_STATE_FULLSCREEN,
};
-// Returns |true| if entry has an internal chrome:// URL, |false| otherwise.
-bool HasInternalURL(const NavigationEntry* entry) {
- if (!entry)
- return false;
-
- // Check the |virtual_url()| first. This catches regular chrome:// URLs
- // including URLs that were rewritten (such as chrome://bookmarks).
- if (entry->GetVirtualURL().SchemeIs(content::kChromeUIScheme))
- return true;
-
- // If the |virtual_url()| isn't a chrome:// URL, check if it's actually
- // view-source: of a chrome:// URL.
- if (entry->GetVirtualURL().SchemeIs(content::kViewSourceScheme))
- return entry->GetURL().SchemeIs(content::kChromeUIScheme);
-
- return false;
-}
-
} // namespace
namespace chrome {
@@ -474,49 +456,6 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
ManagePasswordsForPage(browser_);
break;
- // Page encoding commands
- case IDC_ENCODING_AUTO_DETECT:
- browser_->ToggleEncodingAutoDetect();
- break;
- case IDC_ENCODING_UTF8:
- case IDC_ENCODING_UTF16LE:
- case IDC_ENCODING_WINDOWS1252:
- case IDC_ENCODING_GBK:
- case IDC_ENCODING_GB18030:
- case IDC_ENCODING_BIG5:
- case IDC_ENCODING_KOREAN:
- case IDC_ENCODING_SHIFTJIS:
- case IDC_ENCODING_ISO2022JP:
- case IDC_ENCODING_EUCJP:
- case IDC_ENCODING_THAI:
- case IDC_ENCODING_ISO885915:
- case IDC_ENCODING_MACINTOSH:
- case IDC_ENCODING_ISO88592:
- case IDC_ENCODING_WINDOWS1250:
- case IDC_ENCODING_ISO88595:
- case IDC_ENCODING_WINDOWS1251:
- case IDC_ENCODING_KOI8R:
- case IDC_ENCODING_KOI8U:
- case IDC_ENCODING_IBM866:
- case IDC_ENCODING_ISO88597:
- case IDC_ENCODING_WINDOWS1253:
- case IDC_ENCODING_ISO88594:
- case IDC_ENCODING_ISO885913:
- case IDC_ENCODING_WINDOWS1257:
- case IDC_ENCODING_ISO88593:
- case IDC_ENCODING_ISO885910:
- case IDC_ENCODING_ISO885914:
- case IDC_ENCODING_ISO885916:
- case IDC_ENCODING_WINDOWS1254:
- case IDC_ENCODING_ISO88596:
- case IDC_ENCODING_WINDOWS1256:
- case IDC_ENCODING_ISO88598:
- case IDC_ENCODING_ISO88598I:
- case IDC_ENCODING_WINDOWS1255:
- case IDC_ENCODING_WINDOWS1258:
- browser_->OverrideEncoding(id);
- break;
-
// Clipboard commands
case IDC_CUT:
case IDC_COPY:
@@ -819,43 +758,6 @@ void BrowserCommandController::InitCommandState() {
// Page-related commands
command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true);
command_updater_.UpdateCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_THAI, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOREAN, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_SHIFTJIS, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO2022JP, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_EUCJP, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885915, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_MACINTOSH, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88592, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1250, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88595, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1251, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOI8R, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOI8U, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_IBM866, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88597, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1253, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88594, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885913, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1257, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88593, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885910, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885914, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885916, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1254, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88596, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1256, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88598, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88598I, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1255, true);
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1258, true);
// Zoom
command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true);
@@ -1014,13 +916,6 @@ void BrowserCommandController::UpdateCommandsForTabState() {
if (browser_->is_devtools())
command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
- // Changing the encoding is not possible on Chrome-internal webpages.
- NavigationController& nc = current_web_contents->GetController();
- bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) ||
- current_web_contents->ShowingInterstitialPage();
- command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU,
- !is_chrome_internal && current_web_contents->IsSavable());
-
// Show various bits of UI
// TODO(pinkerton): Disable app-mode in the model until we implement it
// on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698