OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 case IDC_CONTENT_CONTEXT_PASTE: | 936 case IDC_CONTENT_CONTEXT_PASTE: |
937 return !!(params_.edit_flags & WebContextMenuData::CanPaste); | 937 return !!(params_.edit_flags & WebContextMenuData::CanPaste); |
938 | 938 |
939 case IDC_CONTENT_CONTEXT_DELETE: | 939 case IDC_CONTENT_CONTEXT_DELETE: |
940 return !!(params_.edit_flags & WebContextMenuData::CanDelete); | 940 return !!(params_.edit_flags & WebContextMenuData::CanDelete); |
941 | 941 |
942 case IDC_CONTENT_CONTEXT_SELECTALL: | 942 case IDC_CONTENT_CONTEXT_SELECTALL: |
943 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll); | 943 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll); |
944 | 944 |
945 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: | 945 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: |
946 return !profile_->IsOffTheRecord() && params_.link_url.is_valid(); | 946 return !profile_->IsOffTheRecord() && params_.link_url.is_valid() && |
| 947 profile_->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled); |
947 | 948 |
948 case IDC_SPELLCHECK_ADD_TO_DICTIONARY: | 949 case IDC_SPELLCHECK_ADD_TO_DICTIONARY: |
949 return !params_.misspelled_word.empty(); | 950 return !params_.misspelled_word.empty(); |
950 | 951 |
951 case IDC_PRINT: | 952 case IDC_PRINT: |
952 return params_.media_type == WebContextMenuData::MediaTypeNone || | 953 return params_.media_type == WebContextMenuData::MediaTypeNone || |
953 params_.media_flags & WebContextMenuData::MediaCanPrint; | 954 params_.media_flags & WebContextMenuData::MediaCanPrint; |
954 | 955 |
955 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: | 956 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: |
956 case IDC_CONTENT_CONTEXT_GOTOURL: | 957 case IDC_CONTENT_CONTEXT_GOTOURL: |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1477 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1477 g_browser_process->clipboard()); | 1478 g_browser_process->clipboard()); |
1478 } | 1479 } |
1479 | 1480 |
1480 void RenderViewContextMenu::MediaPlayerActionAt( | 1481 void RenderViewContextMenu::MediaPlayerActionAt( |
1481 const gfx::Point& location, | 1482 const gfx::Point& location, |
1482 const WebMediaPlayerAction& action) { | 1483 const WebMediaPlayerAction& action) { |
1483 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1484 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
1484 location, action); | 1485 location, action); |
1485 } | 1486 } |
OLD | NEW |