| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/clipboard.h" | 8 #include "base/clipboard.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 case IDS_CONTENT_CONTEXT_OPENIMAGENEWTAB: | 302 case IDS_CONTENT_CONTEXT_OPENIMAGENEWTAB: |
| 303 // The images shown in the most visited thumbnails do not currently open | 303 // The images shown in the most visited thumbnails do not currently open |
| 304 // in a new tab as they should. Disabling this context menu option for | 304 // in a new tab as they should. Disabling this context menu option for |
| 305 // now, as a quick hack, before we resolve this issue (Issue = 2608). | 305 // now, as a quick hack, before we resolve this issue (Issue = 2608). |
| 306 // TODO (sidchat): Enable this option once this issue is resolved. | 306 // TODO (sidchat): Enable this option once this issue is resolved. |
| 307 if (params_.src_url.scheme() == chrome::kChromeUIScheme) | 307 if (params_.src_url.scheme() == chrome::kChromeUIScheme) |
| 308 return false; | 308 return false; |
| 309 return true; | 309 return true; |
| 310 | 310 |
| 311 case IDS_CONTENT_CONTEXT_FULLSCREEN: | 311 case IDS_CONTENT_CONTEXT_FULLSCREEN: |
| 312 // TODO(ajwong): Enable fullsceren after we actually implement this. | 312 // TODO(ajwong): Enable fullscreen after we actually implement this. |
| 313 return false; | 313 return false; |
| 314 | 314 |
| 315 // Media control commands should all be disabled if the player is in an | 315 // Media control commands should all be disabled if the player is in an |
| 316 // error state. | 316 // error state. |
| 317 case IDS_CONTENT_CONTEXT_PLAY: | 317 case IDS_CONTENT_CONTEXT_PLAY: |
| 318 case IDS_CONTENT_CONTEXT_PAUSE: | 318 case IDS_CONTENT_CONTEXT_PAUSE: |
| 319 case IDS_CONTENT_CONTEXT_MUTE: | 319 case IDS_CONTENT_CONTEXT_MUTE: |
| 320 case IDS_CONTENT_CONTEXT_UNMUTE: | 320 case IDS_CONTENT_CONTEXT_UNMUTE: |
| 321 case IDS_CONTENT_CONTEXT_LOOP: | 321 case IDS_CONTENT_CONTEXT_LOOP: |
| 322 return (params_.media_params.player_state & | 322 return (params_.media_params.player_state & |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 #else | 711 #else |
| 712 bool debug_mode = true; | 712 bool debug_mode = true; |
| 713 #endif | 713 #endif |
| 714 // Don't inspect inspector, new tab UI, etc. | 714 // Don't inspect inspector, new tab UI, etc. |
| 715 if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) && !debug_mode) | 715 if (active_entry->url().SchemeIs(chrome::kChromeUIScheme) && !debug_mode) |
| 716 return false; | 716 return false; |
| 717 | 717 |
| 718 // Don't inspect about:network, about:memory, etc. | 718 // Don't inspect about:network, about:memory, etc. |
| 719 // However, we do want to inspect about:blank, which is often | 719 // However, we do want to inspect about:blank, which is often |
| 720 // used by ordinary web pages. | 720 // used by ordinary web pages. |
| 721 if (active_entry->display_url().SchemeIs(chrome::kAboutScheme) && | 721 if (active_entry->virtual_url().SchemeIs(chrome::kAboutScheme) && |
| 722 !LowerCaseEqualsASCII(active_entry->display_url().path(), "blank")) | 722 !LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank")) |
| 723 return false; | 723 return false; |
| 724 | 724 |
| 725 // Don't enable the web inspector if JavaScript is disabled | 725 // Don't enable the web inspector if JavaScript is disabled |
| 726 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { | 726 if (id == IDS_CONTENT_CONTEXT_INSPECTELEMENT) { |
| 727 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 727 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
| 728 command_line.HasSwitch(switches::kDisableJavaScript)) | 728 command_line.HasSwitch(switches::kDisableJavaScript)) |
| 729 return false; | 729 return false; |
| 730 } | 730 } |
| 731 | 731 |
| 732 return true; | 732 return true; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 WriteTextToClipboard(UTF8ToUTF16(utf8_text)); | 773 WriteTextToClipboard(UTF8ToUTF16(utf8_text)); |
| 774 DidWriteURLToClipboard(utf8_text); | 774 DidWriteURLToClipboard(utf8_text); |
| 775 } | 775 } |
| 776 | 776 |
| 777 void RenderViewContextMenu::MediaPlayerActionAt( | 777 void RenderViewContextMenu::MediaPlayerActionAt( |
| 778 int x, | 778 int x, |
| 779 int y, | 779 int y, |
| 780 const MediaPlayerAction& action) { | 780 const MediaPlayerAction& action) { |
| 781 source_tab_contents_->render_view_host()->MediaPlayerActionAt(x, y, action); | 781 source_tab_contents_->render_view_host()->MediaPlayerActionAt(x, y, action); |
| 782 } | 782 } |
| OLD | NEW |