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

Side by Side Diff: chrome/browser/encoding_menu_controller_delegate.cc

Issue 5005: Reorganize the declarations to have some grouping and logical ordering in tab... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/native_ui_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/encoding_menu_controller_delegate.h" 5 #include "chrome/browser/encoding_menu_controller_delegate.h"
6 6
7 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/character_encoding.h" 10 #include "chrome/browser/character_encoding.h"
(...skipping 10 matching lines...) Expand all
21 browser_(browser) { 21 browser_(browser) {
22 } 22 }
23 23
24 bool EncodingMenuControllerDelegate::IsItemChecked(int id) const { 24 bool EncodingMenuControllerDelegate::IsItemChecked(int id) const {
25 Profile* profile = browser_->profile(); 25 Profile* profile = browser_->profile();
26 if (!profile) 26 if (!profile)
27 return false; 27 return false;
28 TabContents* current_tab = browser_->GetSelectedTabContents(); 28 TabContents* current_tab = browser_->GetSelectedTabContents();
29 if (!current_tab) 29 if (!current_tab)
30 return false; 30 return false;
31 std::wstring encoding_name = current_tab->GetEncoding(); 31 std::wstring encoding_name = current_tab->encoding();
32 if (encoding_name.empty()) 32 if (encoding_name.empty())
33 encoding_name = profile->GetPrefs()->GetString(prefs::kDefaultCharset); 33 encoding_name = profile->GetPrefs()->GetString(prefs::kDefaultCharset);
34 switch (id) { 34 switch (id) {
35 case IDC_ENCODING_AUTO_DETECT: 35 case IDC_ENCODING_AUTO_DETECT:
36 return profile->GetPrefs()->GetBoolean( 36 return profile->GetPrefs()->GetBoolean(
37 prefs::kWebKitUsesUniversalDetector); 37 prefs::kWebKitUsesUniversalDetector);
38 case IDC_ENCODING_UTF8: 38 case IDC_ENCODING_UTF8:
39 case IDC_ENCODING_UTF16LE: 39 case IDC_ENCODING_UTF16LE:
40 case IDC_ENCODING_ISO88591: 40 case IDC_ENCODING_ISO88591:
41 case IDC_ENCODING_WINDOWS1252: 41 case IDC_ENCODING_WINDOWS1252:
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (l10n_util::AdjustStringForLocaleDirection(encoding, 110 if (l10n_util::AdjustStringForLocaleDirection(encoding,
111 &bidi_safe_encoding)) 111 &bidi_safe_encoding))
112 encoding.swap(bidi_safe_encoding); 112 encoding.swap(bidi_safe_encoding);
113 encoding_menu->AppendMenuItem(*it, encoding, Menu::RADIO); 113 encoding_menu->AppendMenuItem(*it, encoding, Menu::RADIO);
114 } 114 }
115 else 115 else
116 encoding_menu->AppendSeparator(); 116 encoding_menu->AppendSeparator();
117 } 117 }
118 } 118 }
119 119
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/native_ui_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698