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

Unified Diff: chrome/browser/browser_commands.cc

Issue 7647: Character encoding override (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | « no previous file | chrome/browser/encoding_menu_controller_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_commands.cc
===================================================================
--- chrome/browser/browser_commands.cc (revision 3674)
+++ chrome/browser/browser_commands.cc (working copy)
@@ -628,12 +628,13 @@
case IDC_ENCODING_WINDOWS1255:
case IDC_ENCODING_WINDOWS1258: {
UserMetrics::RecordAction(L"OverrideEncoding", profile_);
- const std::wstring cur_encoding_name =
+ const std::wstring selected_encoding =
CharacterEncoding::GetCanonicalEncodingNameByCommandId(id);
TabContents* current_tab = GetSelectedTabContents();
- if (!cur_encoding_name.empty() && current_tab)
- current_tab->set_encoding(cur_encoding_name);
- // Update user recently selected encoding list.
+ if (!selected_encoding.empty() && current_tab &&
+ current_tab->AsWebContents())
+ current_tab->AsWebContents()->override_encoding(selected_encoding);
+ // Update the list of recently selected encodings.
std::wstring new_selected_encoding_list;
if (CharacterEncoding::UpdateRecentlySelectdEncoding(
profile_->GetPrefs()->GetString(prefs::kRecentlySelectedEncoding),
« no previous file with comments | « no previous file | chrome/browser/encoding_menu_controller_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698