| OLD | NEW |
| 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/render_view_context_menu_controller.h" | 5 #include "chrome/browser/render_view_context_menu_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_clipboard_writer.h" | 9 #include "base/scoped_clipboard_writer.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 break; | 452 break; |
| 453 | 453 |
| 454 case IDC_CHECK_SPELLING_OF_THIS_FIELD: | 454 case IDC_CHECK_SPELLING_OF_THIS_FIELD: |
| 455 source_web_contents_->render_view_host()->ToggleSpellCheck(); | 455 source_web_contents_->render_view_host()->ToggleSpellCheck(); |
| 456 break; | 456 break; |
| 457 case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY: | 457 case IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY: |
| 458 source_web_contents_->render_view_host()->AddToDictionary( | 458 source_web_contents_->render_view_host()->AddToDictionary( |
| 459 params_.misspelled_word); | 459 params_.misspelled_word); |
| 460 break; | 460 break; |
| 461 | 461 |
| 462 case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS: | 462 case IDS_CONTENT_CONTEXT_LANGUAGE_SETTINGS: { |
| 463 views::Window::CreateChromeWindow( | 463 FontsLanguagesWindowView* window_ = new FontsLanguagesWindowView( |
| 464 source_web_contents_->GetContentHWND(), | 464 source_web_contents_->profile()); |
| 465 gfx::Rect(), | 465 views::Window::CreateChromeWindow(source_web_contents_->GetContentHWND(), |
| 466 new FontsLanguagesWindowView( | 466 gfx::Rect(), window_)->Show(); |
| 467 source_web_contents_->profile()))->Show(); | 467 window_->SelectLanguagesTab(); |
| 468 break; | 468 break; |
| 469 } |
| 469 | 470 |
| 470 case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented. | 471 case IDS_CONTENT_CONTEXT_ADDSEARCHENGINE: // Not implemented. |
| 471 default: | 472 default: |
| 472 break; | 473 break; |
| 473 } | 474 } |
| 474 } | 475 } |
| 475 | 476 |
| 476 bool RenderViewContextMenuController::IsDevCommandEnabled(int id) const { | 477 bool RenderViewContextMenuController::IsDevCommandEnabled(int id) const { |
| 477 CommandLine command_line; | 478 CommandLine command_line; |
| 478 if (command_line.HasSwitch(switches::kAlwaysEnableDevTools)) | 479 if (command_line.HasSwitch(switches::kAlwaysEnableDevTools)) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 506 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { | 507 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { |
| 507 PrefService* prefs = source_web_contents_->profile()->GetPrefs(); | 508 PrefService* prefs = source_web_contents_->profile()->GetPrefs(); |
| 508 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 509 if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
| 509 command_line.HasSwitch(switches::kDisableJavaScript)) | 510 command_line.HasSwitch(switches::kDisableJavaScript)) |
| 510 return false; | 511 return false; |
| 511 } | 512 } |
| 512 | 513 |
| 513 return true; | 514 return true; |
| 514 } | 515 } |
| 515 | 516 |
| OLD | NEW |