diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-08 20:50:05 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-08 20:50:05 +0000 |
commit | f1d306e67b8676336f55aae95652d7cd51359534 (patch) | |
tree | 6f25205e78ba4c69e7b45468b3fdd0f6bed259f5 /chrome/browser/render_view_context_menu_controller.cc | |
parent | b3d565264e6073bd00e4dfd81c8f887ea01fb58c (diff) | |
download | chromium_src-f1d306e67b8676336f55aae95652d7cd51359534.zip chromium_src-f1d306e67b8676336f55aae95652d7cd51359534.tar.gz chromium_src-f1d306e67b8676336f55aae95652d7cd51359534.tar.bz2 |
Cleanup, part 1.
* Consistently use underscores between words in identifiers (IDC_NEWTAB -> IDC_NEW_TAB)
* Make some identifiers clearer or more up-to-date (IDC_DUPLICATE -> IDC_DUPLICATE_TAB, IDC_GOOFFTHERECORD -> IDC_NEW_INCOGNITO_WINDOW, IDC_NEWPROFILEWINDOW -> IDC_PROFILE_MENU)
* Try and make string identifiers (IDS_xxx) match their corresponding IDC_xxx commands. Tony tells me this will not cause any need for retranslation.
* As much as possible (without modifying automated UI test XML files), use "Bookmark Bar", not "Bookmarks Bar" (this seemed to be prevailing usage in the code)
* Fix 80-column issues
This patch touches move files than any subsequent patches, but should be the most rubber-stampable.
Review URL: http://codereview.chromium.org/13633
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_context_menu_controller.cc')
-rw-r--r-- | chrome/browser/render_view_context_menu_controller.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc index e54868c..f8c77cb 100644 --- a/chrome/browser/render_view_context_menu_controller.cc +++ b/chrome/browser/render_view_context_menu_controller.cc @@ -104,8 +104,8 @@ std::wstring RenderViewContextMenuController::GetLabel(int id) const { bool RenderViewContextMenuController::IsCommandEnabled(int id) const { // Allow Spell Check language items on sub menu for text area context menu. - if (id >= IDC_SPELLCHECKER_LANGUAGE_FIRST - && id <= IDC_SPELLCHECKER_LANGUAGE_LAST) { + if ((id >= IDC_SPELLCHECK_LANGUAGES_FIRST) && + (id < IDC_SPELLCHECK_LANGUAGES_LAST)) { return true; } @@ -175,13 +175,13 @@ bool RenderViewContextMenuController::IsCommandEnabled(int id) const { case IDS_CONTENT_CONTEXT_COPYIMAGE: case IDS_CONTENT_CONTEXT_PRINT: case IDS_CONTENT_CONTEXT_SEARCHWEBFOR: - case IDC_USESPELLCHECKSUGGESTION_0: - case IDC_USESPELLCHECKSUGGESTION_1: - case IDC_USESPELLCHECKSUGGESTION_2: - case IDC_USESPELLCHECKSUGGESTION_3: - case IDC_USESPELLCHECKSUGGESTION_4: + case IDC_SPELLCHECK_SUGGESTION_0: + case IDC_SPELLCHECK_SUGGESTION_1: + case IDC_SPELLCHECK_SUGGESTION_2: + case IDC_SPELLCHECK_SUGGESTION_3: + case IDC_SPELLCHECK_SUGGESTION_4: return true; - case IDC_SHOW_SPELLCHECKER_SUBMENU: + case IDC_SPELLCHECK_MENU: return true; case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY: return !params_.misspelled_word.empty(); @@ -204,7 +204,7 @@ bool RenderViewContextMenuController::IsItemChecked(int id) const { int spellcheck_language_index = SpellChecker:: GetSpellCheckLanguagesToDisplayInContextMenu( source_web_contents_->profile(), &display_language_vector); - if (id - IDC_SPELLCHECKER_LANGUAGE_FIRST == spellcheck_language_index) + if (id - IDC_SPELLCHECK_LANGUAGES_FIRST == spellcheck_language_index) return true; return false; @@ -246,19 +246,19 @@ bool RenderViewContextMenuController::GetAcceleratorInfo( void RenderViewContextMenuController::ExecuteCommand(int id) { // Check to see if one of the spell check language ids have been clicked. - if (id >= IDC_SPELLCHECKER_LANGUAGE_FIRST && - id <= IDC_SPELLCHECKER_LANGUAGE_LAST) { + if (id >= IDC_SPELLCHECK_LANGUAGES_FIRST && + id < IDC_SPELLCHECK_LANGUAGES_LAST) { std::vector<std::wstring> display_language_vector; int current_language = SpellChecker:: GetSpellCheckLanguagesToDisplayInContextMenu( source_web_contents_->profile(), &display_language_vector); - if (id - IDC_SPELLCHECKER_LANGUAGE_FIRST < + if (id - IDC_SPELLCHECK_LANGUAGES_FIRST < static_cast<int>(display_language_vector.size())) { StringPrefMember dictionary_language; dictionary_language.Init(prefs::kSpellCheckDictionary, source_web_contents_->profile()->GetPrefs(), NULL); dictionary_language.SetValue(display_language_vector.at( - id - IDC_SPELLCHECKER_LANGUAGE_FIRST)); + id - IDC_SPELLCHECK_LANGUAGES_FIRST)); } return; @@ -433,13 +433,13 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { break; } - case IDC_USESPELLCHECKSUGGESTION_0: - case IDC_USESPELLCHECKSUGGESTION_1: - case IDC_USESPELLCHECKSUGGESTION_2: - case IDC_USESPELLCHECKSUGGESTION_3: - case IDC_USESPELLCHECKSUGGESTION_4: + case IDC_SPELLCHECK_SUGGESTION_0: + case IDC_SPELLCHECK_SUGGESTION_1: + case IDC_SPELLCHECK_SUGGESTION_2: + case IDC_SPELLCHECK_SUGGESTION_3: + case IDC_SPELLCHECK_SUGGESTION_4: source_web_contents_->render_view_host()->Replace( - params_.dictionary_suggestions[id - IDC_USESPELLCHECKSUGGESTION_0]); + params_.dictionary_suggestions[id - IDC_SPELLCHECK_SUGGESTION_0]); break; case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY: |