summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 18:53:16 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 18:53:16 +0000
commitaf9037c87804d9f9b52d800b7c37668e4f45244c (patch)
tree1b7353e44ebbc3351264ad81cea3aa6ac45d964e /chrome
parentc0b2c0f842774e99034eb4454132c8d909bac1bb (diff)
downloadchromium_src-af9037c87804d9f9b52d800b7c37668e4f45244c.zip
chromium_src-af9037c87804d9f9b52d800b7c37668e4f45244c.tar.gz
chromium_src-af9037c87804d9f9b52d800b7c37668e4f45244c.tar.bz2
Add support in spell check options sub-context menu to pop up fonts and languages options menu.
Review URL: http://codereview.chromium.org/12908 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/render_view_context_menu.cc8
-rw-r--r--chrome/browser/render_view_context_menu_controller.cc13
2 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/render_view_context_menu.cc b/chrome/browser/render_view_context_menu.cc
index b50dc9f..db7dc47 100644
--- a/chrome/browser/render_view_context_menu.cc
+++ b/chrome/browser/render_view_context_menu.cc
@@ -154,6 +154,7 @@ void RenderViewContextMenu::AppendEditableItems() {
std::vector<std::wstring> language_vector;
int current_language_index = SpellChecker::
GetSpellCheckLanguagesToDisplayInContextMenu(profile_, &language_vector);
+ // Add the spell check languages.
DCHECK(language_vector.size() <=
IDC_SPELLCHECKER_LANGUAGE_LAST - IDC_SPELLCHECKER_LANGUAGE_FIRST);
const std::wstring app_locale = g_browser_process->GetApplicationLocale();
@@ -162,7 +163,12 @@ void RenderViewContextMenu::AppendEditableItems() {
language_vector.at(i), app_locale, true));
spellchecker_sub_menu_->AppendMenuItem(
IDC_SPELLCHECKER_LANGUAGE_FIRST + i, local_language, RADIO);
- }
+ }
+
+ // Add item in the sub menu to pop up the fonts and languages options menu.
+ spellchecker_sub_menu_->AppendSeparator();
+ spellchecker_sub_menu_->AppendDelegateMenuItem(
+ IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS);
AppendSeparator();
AppendDelegateMenuItem(IDS_CONTENT_CONTEXT_SELECTALL);
}
diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc
index 4943333..43836d2 100644
--- a/chrome/browser/render_view_context_menu_controller.cc
+++ b/chrome/browser/render_view_context_menu_controller.cc
@@ -9,6 +9,7 @@
#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/views/options/fonts_languages_window_view.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
@@ -184,12 +185,12 @@ bool RenderViewContextMenuController::IsCommandEnabled(int id) const {
return true;
case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY:
return !params_.misspelled_word.empty();
+ case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS:
+ return true;
case IDS_CONTENT_CONTEXT_VIEWPAGEINFO:
return (source_web_contents_->controller()->GetActiveEntry() != NULL);
case IDS_CONTENT_CONTEXT_VIEWFRAMEINFO:
return true;
- case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS:
- return true;
case IDS_CONTENT_CONTEXT_SAVEFRAMEAS:
case IDS_CONTENT_CONTEXT_PRINTFRAME:
case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented.
@@ -446,6 +447,14 @@ void RenderViewContextMenuController::ExecuteCommand(int id) {
params_.misspelled_word);
break;
+ case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS:
+ views::Window::CreateChromeWindow(
+ source_web_contents_->GetContentHWND(),
+ gfx::Rect(),
+ new FontsLanguagesWindowView(
+ source_web_contents_->profile()))->Show();
+ break;
+
case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented.
default:
break;